home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacTech 1 to 12
/
MacTech-vol-1-12.toast
/
Reference
/
the cmsp digests ('94-'97)
/
csmp digest Vol 4 No 031
< prev
next >
Wrap
Text File
|
1997-01-03
|
123KB
|
3,644 lines
C.S.M.P. Digest Thu, 02 Jan 97 Volume 4 : Issue 31
Today's Topics:
Best way to support music?
Codewarrior vs. Symantec C++
Debugging an INIT, how ?
DirectX on the Mac??
Easy way Pict -> Rgn or Mask?
FSpCreate Questions.
FatComponent for a QT DataHandler
Get selected files on Finder.
Help with GetKeys();
How to find dirID of my application?
How to get one file at a time in a Mac directory
Launch app with arg
Launching a program
Launching application by signature
PPC ExitToShell Patch?
RPC for Macintosh
Shutdown utility for mac
[Q] Bringing my application to front
[Q] Fading in Thousands
[Q] Playing QT Movies Backwards?
[Q] Show-Hide menubar with QuickTime??
[Q] Suspended or Hidden: How do I tell?
[Q] Useful error messages?
The Comp.Sys.Mac.Programmer Digest is moderated by Mark Aiken
(marka@ee.mcgill.ca).
The digest is a collection of article threads from the internet
newsgroups comp.sys.mac.programmer.help, csmp.tools, csmp.misc and
csmp.games. It is designed for people who read news semi-regularly and
want an archive of the discussions. If you don't know what a
newsgroup is, you probably don't have access to it. Ask your systems
administrator(s) for details. If you don't have access to news, you
may still be able to post messages to the group by using a mail server
like anon.penet.fi (mail help@anon.penet.fi for more information).
Each issue of the digest contains one or more sets of articles (called
threads), with each set corresponding to a 'discussion' of a particular
subject. The articles are not edited; all articles included in this digest
are in their original posted form (as received by our news server at
ee.mcgill.ca). Article threads are not added to the digest until the last
article added to the thread is at least two weeks old (this is to ensure that
the thread is dead before adding it to the digest). Article threads that
consist of only one message are generally not included in the digest.
The digests can be obtained by email, ftp or through the World Wide Web.
If you want to receive the digest by mail, send email to
majordomo@ee.mcgill.ca with no subject and one of the following commands
as body:
help Sends you a summary of commands
subscribe csmp Adds you to the mailing list
unsubscribe csmp Removes you from the list
Once you have subscribed, you will automatically receive each new
issue as it is created.
Back issues are available by ftp from Info-Mac mirror sites in the
per/csmp subdirectory, e.g.
ftp://sumex-aim.stanford.edu/info-mac/per/csmp/
The contents of all back issues can be searched by accessing the
following URL, courtesy of Andrew Barry (ajbarry@ozemail.com.au):
http://marvin.stattech.com.au/search.html
They can also be searched through the following URLs, thanks to
Tim Tuck (Tim.Tuck@sensei.com.au):
http://wais.sensei.com.au/searchform.html
wais://wais.sensei.com.au:210/csmp?
-------------------------------------------------------
>From kurisuto@babel.ling.upenn.edu (Sean Crist)
Subject: Best way to support music?
Date: 25 Nov 1996 03:39:13 GMT
Organization: University of Pennsylvania
I'm writing an application where it would be appropriate for the user to
import some kind of music file created by another application and play it.
What would be the least-effort, most effective way to do this?
Would the MOD format be a good one to support? I know that it used to be
possible to use the music-synthesizing code resources from Sound Trecker
for this purpose, although I can't find the interface or documentation for
any recent version of those resources.
What could QuickTime do for me? Other than movies, it does provide some
kind of support for real-time music synthesis, doesn't it? Can I easily
use imported MIDI data with QuickTime? Which manual should I RTFM?
Thanks.
\/ __ __ _\_ --Sean Crist (kurisuto@unagi.cis.upenn.edu)
--- | | \ / For a free copy of the Bill of Rights, finger
_| ,| ,| ----- this account. It's also available through
_| ,| ,| [_] my homepage:
| | | [_] http://www.ling.upenn.edu/~kurisuto/
+++++++++++++++++++++++++++
>From slur@world.std.com (Scott Lahteine)
Date: Tue, 26 Nov 1996 07:02:36 GMT
Organization: Hot Eggs
In article <57b4d1$oic@netnews.upenn.edu>, kurisuto@babel.ling.upenn.edu
(Sean Crist) wrote:
>I'm writing an application where it would be appropriate for the user to
>import some kind of music file created by another application and play it.
>What would be the least-effort, most effective way to do this?
>
>Would the MOD format be a good one to support? I know that it used to be
>possible to use the music-synthesizing code resources from Sound Trecker
>for this purpose, although I can't find the interface or documentation for
>any recent version of those resources.
Check out PlayerPro 4.5.3 Demo available all over the web. (I found
at the MIT Hyperarchive) It uses the same MOD format familiar from the
old Amiga days, still an _extremely_ popular format for in-program music.
It supports four voices, and the format is extremely simple. I'm unsure
whether PlayerPro's docs cover the MOD format, but docs are Certainly
Available from those Amiga people!
I used MODs awhile ago and enjoyed the ease and portability of both
the format and the player. The current Mac version supports QT
instruments and samples, and gives insight into the workings of Mac
sound. The demo version also includes a fully functional sound editor you
might find useful, though the interface is -quirky-. Cut, amplify, echo,
and all that are in there, faster than SoundHack, more stable than
SampleEditor.
--
- scott slur@world.std.com
"A painting of a rice cake does not satisfy hunger."
+++++++++++++++++++++++++++
>From karlbunker@aol.com
Date: 9 Dec 1996 14:19:30 GMT
Organization: AOL http://www.aol.com
Kenneth Lu <kenlu@mit.edu> sez:
> I, too, really want to be able to use MODs in my programs.
>
> I also found the SoundTrecker libraries on InfoMac, but they are really
> old and don't support CodeWarrior.. they only support THINK.
>
> Does anyone know of any method to get a new version on these
> SoundTrecker libraries?
>
> The man who programmed Sound Trecker lives in Germany and the latest
> version of Sound Trecker contains no email address.
Look for PlayerPro and its developer's kit. Last time I checked, you could
use the PlayerPro libraries in your programs for no charge, and the
package was well supported with updates.
Karl Bunker
KarlBunker@aol.com
http://users.aol.com/karlbunker/
+++++++++++++++++++++++++++
>From Kenneth Lu <kenlu@mit.edu>
Date: Sun, 08 Dec 1996 21:28:31 -0500
Organization: M.I.T.
kurisuto@babel.ling.upenn.edu (Sean Crist) wrote:
> Would the MOD format be a good one to support? I know that it used to be
> possible to use the music-synthesizing code resources from Sound Trecker
> for this purpose, although I can't find the interface or documentation for
> any recent version of those resources.
I, too, really want to be able to use MODs in my programs.
I also found the SoundTrecker libraries on InfoMac, but they are really
old and don't support CodeWarrior.. they only support THINK.
Does anyone know of any method to get a new version on these
SoundTrecker libraries?
The man who programmed Sound Trecker lives in Germany and the latest
version of Sound Trecker contains no email address.
Comrade in plight,
-ToastyKen
P.S. Try to avoid QuickTime MIDI if at all possible. The synthesizer's
playback quality really sucks.
- -----------------------------
| Kenneth Lu -- kenlu@mit.edu |
- -----------------------------
+++++++++++++++++++++++++++
>From Kenneth Lu <kenlu@mit.edu>
Date: Mon, 09 Dec 1996 14:53:44 -0500
Organization: M.I.T.
[Summary: Someone else and I both wanted to find a newer version of the
Sound Trecker API that would work with CodeWarrior, and Karl mentioned
PlayerPro.]
Thanks, Karl! I got it off of InfoMac. The player is pretty dam'd
expensive for shareware,
but the API is 100% free for any use!
I find that really impressive. It's in CodeWarrior format, too! Thanks
again!
-ToastyKen
- -----------------------------
| Kenneth Lu -- kenlu@mit.edu |
- -----------------------------
+++++++++++++++++++++++++++
>From elliottmc@cf.ac.uk (Mark Elliott)
Date: Thu, 12 Dec 1996 15:07:25 GMT
Organization: Department of Chemistry, University of Cardiff
The PlayerPro libraries are good and free. If you want to manipulate the
music files, you will need the PlayerPro application which is shareware,
although I believe the fee is a ridiculous $100 or thereabouts. I paid
before he put the price up. This stuff should all be on info-mac.
Apologies if the price is not correct.
Mark
In article <32AB7949.26FD@mit.edu>, kenlu@mit.edu wrote:
> kurisuto@babel.ling.upenn.edu (Sean Crist) wrote:
> > Would the MOD format be a good one to support? I know that it used to be
> > possible to use the music-synthesizing code resources from Sound Trecker
> > for this purpose, although I can't find the interface or documentation for
> > any recent version of those resources.
>
> I, too, really want to be able to use MODs in my programs.
>
> I also found the SoundTrecker libraries on InfoMac, but they are really
> old and don't support CodeWarrior.. they only support THINK.
>
> Does anyone know of any method to get a new version on these
> SoundTrecker libraries?
>
> The man who programmed Sound Trecker lives in Germany and the latest
> version of Sound Trecker contains no email address.
>
> Comrade in plight,
>
> -ToastyKen
>
> P.S. Try to avoid QuickTime MIDI if at all possible. The synthesizer's
> playback quality really sucks.
>
> -------------------------------
> | Kenneth Lu -- kenlu@mit.edu |
> -------------------------------
---------------------------
>From markn@ms8.hinet.net ()
Subject: Codewarrior vs. Symantec C++
Date: 13 Dec 1996 14:24:38 GMT
Organization: DCI HiNet
I notice that in the Mac Warehouse catalog, the price of Codewarrior is
more than four times the price of Symantec C++. What is the difference
between these two compilers? Is Codewarrior really more than four times
better?
Mark
+++++++++++++++++++++++++++
>From pteeson@interlog.com (Peter Teeson)
Date: 14 Dec 1996 13:49:32 GMT
Organization: InterLog Internet Services
In article <58rov6$7m5@netnews.hinet.net>, markn@ms8.hinet.net () wrote:
>I notice that in the Mac Warehouse catalog, the price of Codewarrior is
>more than four times the price of Symantec C++. What is the difference
>between these two compilers? Is Codewarrior really more than four times
>better?
>
>Mark
I've been a long time user of the THINK C product which was bought by Symantec
years ago. I've developed shrinkwrap with it for some well know companies.
It's a very professional tool set. IMHO the IDE is still ahead of CodeWarrior.
HOWEVER I no longer use it because of Symantec's long standing lack of support,
lack of continued development and arrogantly unresponsive attitude.
With all its warts, some of which will disappear in time I'm sure, CodwWarrior
(and ETO) are the professional tools I use these days on a daily basis.
The most impressive things about Metrowerks are:
(0) They listen AND respond to their customers
(1) They listen AND respond to their customers
(2) They listen AND respond to their customers
The major weakness' in their IDE (versus Symantec) imho:
(0) no ability to have multiple projects open simultaneously
(1) no ability to nest projects (great for doing builds)
(2) mildly less mature compiler
A major strength is the PowerPlant framework/class library which is pretty well
the best thing since sliced bread.
Sad as I am to see Symantec repeatedly dropping the ball I am thankful that Metrowerks
is there to pick it up and score.
Go with CodeWarrior... you'll not regret it.
Peter
--
General Consulting & Research Inc.
712 - 24 Forest Manor Road
Willowdale, ON
M2J 1M3
416-494-5888 voice 416-494-4832 fax
"Developing quality software requires a great deal of effort
over a long period of time." Doug Schmidt - C++ Report May 1996
+++++++++++++++++++++++++++
>From donarb@wolfenet.com (Don Arbow)
Date: Fri, 13 Dec 1996 11:39:42 -0800
Organization: Wolfe Internet Access, L.L.C.
In article <58rov6$7m5@netnews.hinet.net>, markn@ms8.hinet.net () wrote:
: I notice that in the Mac Warehouse catalog, the price of Codewarrior is
: more than four times the price of Symantec C++. What is the difference
: between these two compilers? Is Codewarrior really more than four times
: better?
:
: Mark
Well, I'm not sure what the Symantec package includes, but with
Codewarrior you get C/C++, Pascal and Java language support. For
platforms, you get 68k, PPC, Windows (95/NT), Magic Cap and BeOS. Once
you pay $399, its only $199 per year after that to renew your
subscription.
Don
--
- ------------------------------------------------------------------------
\ | / Don Arbow, Partner, CTO | donarb@wolfenet.com
-- EDO -- EveryDay Objects, Inc. | http://www.edo-inc.com
/ | \ Seattle, WA |
- ------------------------------------------------------------------------
My Prographing web page: http://www.wolfe.net/~donarb/Dataflow.html
"The fix is only temporary, unless it works" - Red Green
- ------------------------------------------------------------------------
+++++++++++++++++++++++++++
>From Rod Magnuson <RMagnuson@Symantec.com>
Date: Fri, 13 Dec 1996 17:58:18 -0700
Organization: Symantec Corp.
markn@ms8.hinet.net wrote:
>
> I notice that in the Mac Warehouse catalog, the price of Codewarrior is
> more than four times the price of Symantec C++. What is the difference
> between these two compilers? Is Codewarrior really more than four times
> better?
>
> Mark
Simple answer would be "no", but really it depends on what you are
doing. If you are interested in learning C++ or doing some programming
in your spare time than either environment will probably do you fine. If
you have special needs (want to write Windows, Magic Cap, or BE (this
may be all of us soon)) you should go with CodeWarrior, since Symantec
does not provide solutions for this. In either case I'd suggest looking
at both products.
<plug on>
If you want to learn java, I wouldn't recommend going with a swiss army
knife product and I'd suggest going with something like Visual Cafe for
Macintosh, of course I'm biased (I work on the Visual Cafe team).
<plug off>
Good luck!
Rod
+++++++++++++++++++++++++++
>From scr@mindspring.com (Steve Rose)
Date: Sat, 14 Dec 1996 00:01:57 -0500
Organization: MindSpring Enterprises
In article <32B1FBAA.52BE@Symantec.com>, Rod Magnuson
<RMagnuson@Symantec.com> wrote:
> <plug on>
> If you want to learn java, I wouldn't recommend going with a swiss army
> knife product and I'd suggest going with something like Visual Cafe for
> Macintosh, of course I'm biased (I work on the Visual Cafe team).
> <plug off>
So when will Visual Cafe Mac be released? The PR1 release is barely useable
right now. It takes several minutes just to change a component name on my
PowerMac 8100, and the debugger is far too limitedbe useful. I have taken
to laying out a screen in Visual Cafe, and then using Codewarrior 10 to
edit and debug the code!
- ------------------------------------------
scr@mindspring.com
http://www.mindspring.com/~scr/scr_Home.html
+++++++++++++++++++++++++++
>From Rod Magnuson <RMagnuson@Symantec.com>
Date: Sat, 14 Dec 1996 04:28:10 -0700
Organization: Symantec Corp.
Steve Rose wrote:
>
> In article <32B1FBAA.52BE@Symantec.com>, Rod Magnuson
> <RMagnuson@Symantec.com> wrote:
>
> > <plug on>
> > If you want to learn java, I wouldn't recommend going with a swiss army
> > knife product and I'd suggest going with something like Visual Cafe for
> > Macintosh, of course I'm biased (I work on the Visual Cafe team).
> > <plug off>
>
> So when will Visual Cafe Mac be released? The PR1 release is barely useable
> right now. It takes several minutes just to change a component name on my
> PowerMac 8100, and the debugger is far too limitedbe useful. I have taken
> to laying out a screen in Visual Cafe, and then using Codewarrior 10 to
> edit and debug the code!
>
> --------------------------------------------
> scr@mindspring.com
> http://www.mindspring.com/~scr/scr_Home.html
Visual Cafe will be released REAL SOON NOW. That's exactly what I've
been told to say so as to not give our competition any hints as to the
date. But if I was to hint at it, and I'm certain our competition could
guess at this (so I'm not giving anything away), we would probably want
our launch to be at a big mac event early in the year.
Typing performance problems? Yep we had em. They will be fixed in the
release. As for the debugger, we have made some additions (watch window)
and it is now pretty stable and fast, but is there anything in
particular we're missing. Run into anything else annoying?
Appreciate the feedback!
Rod
+++++++++++++++++++++++++++
>From pteeson@interlog.com (Peter Teeson)
Date: 18 Dec 1996 08:39:36 GMT
Organization: InterLog Internet Services
In article <5919c3$2r0@stc06.ctd.ornl.gov>, "Thomas L. Ferrell" <ferrelltl@ornl.gov> wrote:
>Mick and others have reported the straight story on this--CW support is
>tremendous. I use Sym, CW, & MPW. One thing Metrowerks has done to Sym
>is to get them going in the right direction in some ways. I hope that
>they continue to boost up their SW and support so that we'll continue to
>have options. It would be awfully hard for me to give up Sym altogether,
>but I know the deep-seated anger that many feel.
>tom
Hey I don't feel anger...I'm not paid to run Symantec. This is about the tools of our trade.
As the new artisans and craftspeople we choose what for us are the best tools.
Symantec, Metrowerks, Appmaker, and for that matter a renewed Apple MPW team,
provide us with them.
I just periodically go shopping for nifty new tools to make my life easier.
Symantec management would appear to continue to suffer from severe rectal myopia.
Their *engineers* have done a great job...and many of the great ones have moved on to
more fertile environments. Many of them are still there.
However personally speaking I no longer expect, based on the evidence, to see any sustained
effort on Symantec's part to support and enhance their IDE. They are all chanting the Java
mantra these days.
Fortunately or unfortunately that is not the arena in which I need tools.
Just my 0.02¢.
Peter
--
General Consulting & Research Inc.
712 - 24 Forest Manor Road
Willowdale, ON
M2J 1M3
416-494-5888 voice 416-494-4832 fax
"Developing quality software requires a great deal of effort
over a long period of time." Doug Schmidt - C++ Report May 1996
+++++++++++++++++++++++++++
>From "Thomas L. Ferrell" <ferrelltl@ornl.gov>
Date: 15 Dec 1996 16:35:15 GMT
Organization: Oak Ridge National Lab
Mick and others have reported the straight story on this--CW support is
tremendous. I use Sym, CW, & MPW. One thing Metrowerks has done to Sym
is to get them going in the right direction in some ways. I hope that
they continue to boost up their SW and support so that we'll continue to
have options. It would be awfully hard for me to give up Sym altogether,
but I know the deep-seated anger that many feel.
tom
---------------------------
>From Olivier Beaudoux <beaudoux@lra.eseo.fr>
Subject: Debugging an INIT, how ?
Date: Fri, 06 Dec 1996 15:03:40 -0800
Organization: Universite d'Angers, France.
Hi,
I'm programming an INIT using CodeWarior C/C++.
How can I debug it ?
Can I reinstall new version of my INIT without reboot the system ?
Thanks for help.
Bod
+++++++++++++++++++++++++++
>From david_rehring@gdt.com (David Rehring)
Date: Mon, 09 Dec 1996 12:36:11 -0800
Organization: GDT Softworks, Inc.
>>On Fri, Dec 6, 1996,3:03 PM Olivier Beaudoux wrote:
>>>Hi,
>>>
>>>I'm programming an INIT using CodeWarior C/C++.
>>>How can I debug it ?
>>>Can I reinstall new version of my INIT without reboot the system ?
>>>
>>>Thanks for help.
>>>Bod
>>>
>>End of excerpt from Olivier Beaudoux.
Jasik's Debugger.
-make a .SYM(using CW) file and .dsi file(just a text file) containing
=B
main
It's THE debugger to use debugging code resources, esp. ones that have code
that runs at interrupt time (like completion routines).
Later,
--
David Rehring
Senior Software Engineer
GDT Softworks, Inc.
And all around insane guy!
+++++++++++++++++++++++++++
>From andym@netmanage.com
Date: Mon, 9 Dec 96 09:12:06 +0000
Organization: (none)
Well this is a tough one.
If your INIT patches a trap then there's no way I know of to reinstall it
without rebooting.
Here's some things I use:
Ä Work on 2 machines. Debugging an INIT on the same machine is a pain :-)
Ä Write your own DebugStr routine - here's the one I use:
void DebugMessage(Str255 p, short errNo)
{
Str63 errstr;
if(errNo==0)
DebugStr(p);
else
{
DebugStr(p);
NumToString(errNo,errstr);
DebugStr(errstr);
}
}
Ä Call this routine in strategic places, i.e. before and after patching the
trap, in the patch, and in error checking. The good thing about it is that
you can control the flow,
like :
DebugMessage("\p Entering the function foo() ",0);
and check for errors:
DebugMessage("\pTried to call Bar().Error returned is ",errNo);
Ä Check for errors!
Memory , Resource and File Manager errors should be checked religiously.
Always call MemError() after each memory allocation and ResError() after
each Res Mgr call.
Ä Don't assume anything in an INIT.
You're operating in a very hostile environment :-)
You can't allocate too much memory, you can't get to your globals without
SetCurrentA4()/SetA4(), your resource file is closed, you don't have the
access to the events ( unless it's a JGNE filter) etc, etc...
Writing an INIT is sorta like sneaking into someone's house in the middle of
the night and trying to do a spring cleaning :-)
But it's fun:-)
Good luck
HTH, Andy
On Fri, Dec 6, 1996,3:03 PM Olivier Beaudoux wrote:
>Hi,
>
>I'm programming an INIT using CodeWarior C/C++.
>How can I debug it ?
>Can I reinstall new version of my INIT without reboot the system ?
>
>Thanks for help.
>Bod
>
End of excerpt from Olivier Beaudoux.
---------------------------
>From dsi@interaccess.com (Taz)
Subject: DirectX on the Mac??
Date: Sat, 07 Dec 1996 05:56:34 GMT
Organization: InterAccess, Chicago's best Internet Service Provider
Is there anyone who has heard of DirectX on the MAC??
Is it real ? Is it fast??
Thanks Bob.
+++++++++++++++++++++++++++
>From William Jones <jjones@cswnet.com>
Date: Sat, 14 Dec 1996 04:37:00 -0600
Organization: CSW Net, Inc.
Taz wrote:
>
> Is there anyone who has heard of DirectX on the MAC??
> Is it real ? Is it fast??
> Thanks Bob.
Are you serious? It's like asking if Microsoft is going to port the
Windows Explorer to the Mac.
DirectX was developed my Microsoft so games makers could access
video(and sound) at the lowest-levels while in Windows. That is why Win
3.1 never had any realtime 3-d games but DOS did. (In DOS programmers
can do whatever they want)
William Jones
+++++++++++++++++++++++++++
>From jc@or.psychology.dal.ca (John Christie)
Date: 15 Dec 1996 20:35:37 GMT
Organization: ISINet, Nova Scotia
If you use CodeWarrior you will soon be able to use GameWerks
that will allow you to develop one game that works cross platform. On
the Mac it uses Game Sprockets and on the PC it uses DirectX.
--
- ----------------------------------------------------------------
John Christie
"You aren't free because you CAN choose - only if you DO choose."
"All you are is the decisions you make. If you let circumstances make
them for you then what you are becomes very easy to estimate."
+++++++++++++++++++++++++++
>From dsi@interaccess.com (Taz)
Date: Sun, 15 Dec 1996 23:31:40 GMT
Organization: InterAccess, Chicago's best Internet Service Provider
Just to let you know I have found out it
exists but runs like .... (you fill it in) on the MAC.
Bob.
>Taz wrote:
>>
>> Is there anyone who has heard of DirectX on the MAC??
>> Is it real ? Is it fast??
>> Thanks Bob.
>
>Are you serious? It's like asking if Microsoft is going to port the
>Windows Explorer to the Mac.
>DirectX was developed my Microsoft so games makers could access
>video(and sound) at the lowest-levels while in Windows. That is why Win
>3.1 never had any realtime 3-d games but DOS did. (In DOS programmers
>can do whatever they want)
>
>William Jones
+++++++++++++++++++++++++++
>From rrclark@artsci.wustl.edu (R. Ryan Clark)
Date: Mon, 16 Dec 1996 09:31:46 GMT
Organization: Washington University in St. Louis, MO USA
On Sat, 14 Dec 1996 04:37:00 -0600, William Jones <jjones@cswnet.com>
wrote:
>Taz wrote:
>>
>> Is there anyone who has heard of DirectX on the MAC??
>> Is it real ? Is it fast??
>> Thanks Bob.
>
>Are you serious? It's like asking if Microsoft is going to port the
>Windows Explorer to the Mac.
>DirectX was developed my Microsoft so games makers could access
>video(and sound) at the lowest-levels while in Windows. That is why Win
>3.1 never had any realtime 3-d games but DOS did. (In DOS programmers
>can do whatever they want)
Actually, Microsoft IS releasing DirectX for the Powermac platform.
I don't know if it's available yet, or how well it performs.
I suppose it will be most useful for the translation of Win95 games to
the Macintosh.
-R. Ryan Clark
---------------------------
>From Stephen Kay <70714.1356@CompuServe.COM>
Subject: Easy way Pict -> Rgn or Mask?
Date: 9 Dec 1996 23:00:40 GMT
Organization: TechniSound
Is there an easy way to get the outline of a pict so you can copy
the pict through it as a mask onto an already drawn background? I've
been trying to use CalcMask, but it I'm having trouble with grey
scales. i.e. I want the outline of any pixel that's non-white.
Thanks,
--
Stephen Kay - composer, producer, programmer
+++++++++++++++++++++++++++
>From BHuey@worldnet.att.net (Hugh Johnson)
Date: Mon, 09 Dec 1996 18:38:08 -0600
Organization: Semplice
In article <58i5mo$mr6$1@mhadf.production.compuserve.com>, Stephen Kay
<70714.1356@CompuServe.COM> wrote:
> Is there an easy way to get the outline of a pict so you can copy
> the pict through it as a mask onto an already drawn background? I've
> been trying to use CalcMask, but it I'm having trouble with grey
> scales. i.e. I want the outline of any pixel that's non-white.
>
What you could do is CopyBits your image into an old-fashioned 1-bit
grafport (thereby turning all the colors to black-and-white), then use
CalcMask or BitmapToRgn.
+++++++++++++++++++++++++++
>From tonyn@tiac.net (Tony Nelson)
Date: Mon, 09 Dec 1996 20:31:02 -0500
Organization: <none>
In article <58i5mo$mr6$1@mhadf.production.compuserve.com>, Stephen Kay
<70714.1356@CompuServe.COM> wrote:
> Is there an easy way to get the outline of a pict so you can copy
> the pict through it as a mask onto an already drawn background? I've
> been trying to use CalcMask, but it I'm having trouble with grey
> scales. i.e. I want the outline of any pixel that's non-white.
>From NIM _Imaging with QuickDraw_, p.3-116:
> When you use CopyBits on a computer running Color QuickDraw, you can also
> specify one of the following transfer modes in the mode parameter:
> ...
> transparent = 36; {replace the destination pixel with the }
> { source pixel if the source pixel isn't }
> { equal to the background color}
If the pict was made with a transparent _CopyBits, you're done. If not,
draw it into a GWorld and copy the result to the destination. (Do it in
bands if there isn't enough memory.)
____________________________________________________________________
TonyN.:' tonyn@tiac.net
'
---------------------------
>From mschwa4259@aol.com
Subject: FSpCreate Questions.
Date: 9 Dec 1996 00:23:24 GMT
Organization: AOL http://www.aol.com
Hey Folks,
I previously posted about StandardPutFile and creating without calling it.
I guess I was vague about what I needed to know. Basically, I wanted to
know what I had to do in order call FSpCreate(), without having a value in
the systemScript field. If I call FSMakeFSSpec() with the VolRef and
DirID for the Folder I want; but what do I put in the filename section.
nil?? Then what do I do to create the file with FSpCreate. If the spec
it returns will work, and my creator ad types. What goes in the ScriptCode
field, smSystemScript, What will this name the file. After this can I
just call FSOpenDF() with this FSSpec And get the correct refnum. I guess
I'm just not clear on what exactly a file spec contains. Or what's needed
exactly to create a file.
Thanks,
Matt
+++++++++++++++++++++++++++
>From stian@mail.utexas.edu (Stian Oksavik)
Date: 9 Dec 1996 10:53:43 GMT
Organization: University of Texas at Austin
In article <19961209002300.TAA25170@ladder01.news.aol.com>,
mschwa4259@aol.com wrote:
> Hey Folks,
>
> I previously posted about StandardPutFile and creating without calling it.
> I guess I was vague about what I needed to know. Basically, I wanted to
> know what I had to do in order call FSpCreate(), without having a value in
> the systemScript field. If I call FSMakeFSSpec() with the VolRef and
> DirID for the Folder I want; but what do I put in the filename section.
> nil??
Nope, you put the name of your scratch file. For instance
"\pMyApp.scratch". Since this is one thing the user should never see, I
think you can safely hard code it into your code...although there's
nothing wrong with storing it in a resource.
> Then what do I do to create the file with FSpCreate. If the spec
> it returns will work, and my creator ad types.
Yes.
> What goes in the ScriptCode
> field, smSystemScript
I would think the current script system. I think you can also just put
nil, AFAIK this should get you the Roman script system, which is always
present.
> What will this name the file. After this can I
> just call FSOpenDF() with this FSSpec And get the correct refnum. I guess
> I'm just not clear on what exactly a file spec contains. Or what's needed
> exactly to create a file.
Pretty much what you wrote above. Just supply a filename and you should be OK.
Hope this helps,
-Stian
+++++++++++++++++++++++++++
>From jude@smellycat.com (Jude Giampaolo)
Date: Sun, 08 Dec 1996 20:27:22 -0500
Organization: CyberDrugs
In article <19961209002300.TAA25170@ladder01.news.aol.com>,
mschwa4259@aol.com wrote:
> I previously posted about StandardPutFile and creating without calling it.
> I guess I was vague about what I needed to know. Basically, I wanted to
> know what I had to do in order call FSpCreate(), without having a value in
> the systemScript field. If I call FSMakeFSSpec() with the VolRef and
> DirID for the Folder I want; but what do I put in the filename section.
> nil?? Then what do I do to create the file with FSpCreate. If the spec
> it returns will work, and my creator ad types. What goes in the ScriptCode
> field, smSystemScript, What will this name the file. After this can I
> just call FSOpenDF() with this FSSpec And get the correct refnum. I guess
> I'm just not clear on what exactly a file spec contains. Or what's needed
> exactly to create a file.
Let me see if I can walk you though it.... (Sorry about the pascal, but my
C is really embarrasingly sloppy)
If I remember correctly you were looking to make a temporary file so...
{First we call FindFolder to get the volume reference number and the
directory ID of the temporary items folder:}
myErr:=FindFolder(kOnSystemDisk,kTemporaryFolderType,true,theVRefNum,theDirID);
{Now we can create the file spec:}
myErr:=FSMakeFSSpec(theVRefNum,theDirID,theFileSpec);
{After the file spec is created we then can create the file.
theCreatorCode is generally the same as the creator type for the
application and theFileType can be pretty much anything you want or need
it to be. ('TEXT" for a text file, etc.):}
myErr:=FSpCreate(theFileSpec,theCreatorCode,theFileType,smSystemScript);
{Once the file is created it can be opened:}
myErr:=FSpOpenDF(theFileSpec,fsRdWrPerm,theFileRefNum);
{Do stuff with theFileSpec here....}
{Make sure to close the file when you are finished with it:}
myErr:=FSClose(theFileRefNum);
{And since it is a temp file it should be deleted:}
myErr:=FSpDelete(theFileSpec);
I hope that helps.....
--
Jude Charles Giampaolo 'I was lined up for glory, but the
jcg161@psu.edu tickets sold out in advance'
jude@smellycat.com http://prozac.cwru.edu/jude/JudeHome.html
+++++++++++++++++++++++++++
>From David Gillies <daggilli@vader.brad.ac.uk>
Date: Tue, 10 Dec 1996 14:46:16 +0000
Organization: University of Bradford
mschwa4259@aol.com wrote:
>
> Hey Folks,
>
> I previously posted about StandardPutFile and creating without calling it.
> I guess I was vague about what I needed to know. Basically, I wanted to
> know what I had to do in order call FSpCreate(), without having a value in
> the systemScript field. If I call FSMakeFSSpec() with the VolRef and
> DirID for the Folder I want; but what do I put in the filename section.
> nil?? Then what do I do to create the file with FSpCreate. If the spec
> it returns will work, and my creator ad types. What goes in the ScriptCode
> field, smSystemScript, What will this name the file. After this can I
> just call FSOpenDF() with this FSSpec And get the correct refnum. I guess
> I'm just not clear on what exactly a file spec contains. Or what's needed
> exactly to create a file.
>
> Thanks,
>
> Matt
typedef struct FSSpec
{
short vRefNum;
long parID;
Str63 name;
}FSSpec;
typedef FSSpec *FSSpecPtr,*FSSpecArrayPtr,**FSSpecHandle;
Say you want to create the file "MyFile", in the directory "Some Dir"
which has the ID 12054 in the disk "My Disk" which has the volume
reference number -1, then call
short refNum=-1;
long dirID=12054;
Str63 name="\pMyFile";
FSSpec newFSS;
OSErr fileErr;
OSType creatorCode,fileType;
fileErr=FSMakeFSSpec(refNum,dirID,name,&newFSS);
if(fileErr==fnfErr) // file doesn't exist - make it
{
// can't remember if I've got the creator and type the right way round
fileErr=FSpCreate(&newFSS,creatorCode,fileType,smSystemScript)
}
else
{
switch(fileErr)
{
case noErr:
// we're ok - carry on;
break;
case etc....
// handle errors
}
}
--
______________________________________________________________________
David A. G. Gillies (daggilli@vader.brad.ac.uk)
University of Bradford, Bradford, West Yorkshire, England
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
---------------------------
>From email@domain.com (Your Name)
Subject: FatComponent for a QT DataHandler
Date: Wed, 04 Dec 1996 20:56:26 -0700
Organization: Oracle Corporation. Redwood Shores, CA
I am trying to get a FatComponent (QT Data Handler) running on the Mac.
I have built the Code Warrior Example 'FatComponent' and it works.
But, my component does not Open at all with the OpenComponent call. It
seems that Registration went OK. Since there are no error codes from
OpenComponent I have no idea why my component is being opened, the
component;'s Open code is not even called.
Are there any Component writers out there?
SaS -- Oracle Video Server
+++++++++++++++++++++++++++
>From sschmukl@us.oracle.com (Stuart Schmukler)
Date: Wed, 04 Dec 1996 21:20:42 -0700
Organization: Oracle
I forgot to set my address.
In article <email-0412962056260001@pkiddle-mac.us.oracle.com>,
email@domain.com (Your Name) wrote:
> I am trying to get a FatComponent (QT Data Handler) running on the Mac.
>
> I have built the Code Warrior Example 'FatComponent' and it works.
>
> But, my component does not Open at all with the OpenComponent call. It
> seems that Registration went OK. Since there are no error codes from
> OpenComponent I have no idea why my component is being opened, the
> component;'s Open code is not even called.
>
> Are there any Component writers out there?
>
> SaS -- Oracle Video Server
+++++++++++++++++++++++++++
>From mcookson@ricochet.net (Mark Cookson)
Date: Sat, 07 Dec 1996 12:19:04 -0800
Organization: (none)
> > I am trying to get a FatComponent (QT Data Handler) running on the Mac.
> >
> > I have built the Code Warrior Example 'FatComponent' and it works.
> >
> > But, my component does not Open at all with the OpenComponent call. It
> > seems that Registration went OK. Since there are no error codes from
> > OpenComponent I have no idea why my component is being opened, the
> > component;'s Open code is not even called.
> >
> > Are there any Component writers out there?
> >
> > SaS -- Oracle Video Server
Your component has to be opened before it can be registered. When
registering (like at boot time) your dispatch function first calls the open
function, then calls the register function, and then the close function, if
your open function never gets called then either your dispatch function is
messed up or something really strange is happening.
Have you put a DebugStr as the first line of the open function?
If you use the thing command in MacsBug, does your component show up in the
list?
Mark
+++++++++++++++++++++++++++
>From sschmukl@us.oracle.com (Stuart Schmukler)
Date: Wed, 11 Dec 1996 12:57:24 -0700
Organization: Oracle New Media
In article <mcookson-ya023180000712961219040001@news.ricochet.net>,
mcookson@ricochet.net (Mark Cookson) wrote:
> > > I am trying to get a FatComponent (QT Data Handler) running on the Mac.
> > >
> > > I have built the Code Warrior Example 'FatComponent' and it works.
> > >
> > > But, my component does not Open at all with the OpenComponent call. It
> > > seems that Registration went OK. Since there are no error codes from
> > > OpenComponent I have no idea why my component is being opened, the
> > > component;'s Open code is not even called.
> > >
> > > Are there any Component writers out there?
> > >
> > > SaS -- Oracle Video Server
>
> Your component has to be opened before it can be registered.
...
I am not sure this is true. It sounds like a chicken and an egg
problem. I have seen Components
that register other components at boot time. Some one has to register the
component before it can be called.
>
> Have you put a DebugStr as the first line of the open function?
>
Yes.
> If you use the thing command in MacsBug, does your component show up in the
> list?
>
If I use the PPC component I get:
Cnt tRef# ThingName Type SubT Manu Flags EntryPnt FileName Prnt
LocalA5 RefCon
...
#0 0200FC DataH test. dhlr alis orcl 00000000 50FF8001 0000294C
00000000 00000000
The EntryPoint is from EBBE's deamon seed. So, I hacked my thing resource
to point only at the 69K version of my component and it registers and runs
fine. It seems that I am making some mistake in the PPC coding.
Cnt tRef# ThingName Type SubT Manu Flags EntryPnt FileName Prnt
LocalA5 RefCon
...
#0 0200FE DataH test. dhlr alis orcl 00000000 007ED510 00002950
00000000 00000000
One short reference in A_Fragment_of_your_Imagination leads me to believe
that the CFM is having trouble with the RoutineDescriptors in the code or
the UPPs. I removed all of the RoutineDescriptors
and got closer, but the PPC code is still not loading.
> Mark
Thank-you for your support.
SaS -- Oracle Video Server
---------------------------
>From h943318b@eds.ecip.nagoya-u.ac.jp (Kaneko Tetsuya )
Subject: Get selected files on Finder.
Date: 1 Dec 1996 05:59:13 GMT
Organization: Education Center for Information Processing, Nagoya Univ.
I'm programming on MW C/C++.
I want to get files or folders selected (and highlighted) on Finder
in INIT sources.
Can I do it?
Please tell me how to do.
+++++++++++++++++++++++++++
>From test@admin
Date: Mon, 2 Dec 96 12:08:32 +0000
Organization: (none)
Check out "Scripting the Finder" by Greg Anderson in develop #20.
HTH
On Sun, Dec 1, 1996,5:59 AM Kaneko Tetsuya wrote:
>I'm programming on MW C/C++.
>
>I want to get files or folders selected (and highlighted) on Finder
> in INIT sources.
>
>Can I do it?
>Please tell me how to do.
>
End of excerpt from Kaneko Tetsuya.
+++++++++++++++++++++++++++
>From David Gillies <daggilli@vader.brad.ac.uk>
Date: Wed, 04 Dec 1996 14:20:46 +0000
Organization: University of Bradford
test@admin wrote:
>
> Check out "Scripting the Finder" by Greg Anderson in develop #20.
> HTH
>
> On Sun, Dec 1, 1996,5:59 AM Kaneko Tetsuya wrote:
> >I'm programming on MW C/C++.
> >
> >I want to get files or folders selected (and highlighted) on Finder
> > in INIT sources.
> >
> >Can I do it?
> >Please tell me how to do.
> >
> End of excerpt from Kaneko Tetsuya.
A bit more detail:
Make a Get Data event passing 'the selection' in as the direct object.
Returns an object specifier which you can pull apart to find the
selected objects.
Very easy really (afternoon's work at most if you read Greg Anderson's
article - which IMHO is one of the best develop ever published).
If you are not using System 7.5 or later, then forget it. I do know
how to do it in pre 7.5 systems, but it is a totally unsanctioned
and evil hack which I fear to share with the world.
--
______________________________________________________________________
David A. G. Gillies (daggilli@vader.brad.ac.uk)
University of Bradford, Bradford, West Yorkshire, England
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
+++++++++++++++++++++++++++
>From Olivier Beaudoux <beaudoux@lra.eseo.fr>
Date: Fri, 06 Dec 1996 14:42:22 -0800
Organization: Universite d'Angers, France.
Hi,
You can use the copy/paste feature (scrap manager) with jGNE (a patch to
the MacOS GetNextEvent function).
1. Get an event with jGNE that tell you about a mouse down or/and a key
down.
2. Save the content of the scrap area (in an other buffer).
3. Generate a copy to see if scrap is empty or not. If not, you've get
the name of the interest file/folder. If it's empty, generate a 'return'
keydown event with the PostEvent function; redo the copy and it's now
ok.
4. Restitute the saved scrap buffer to the real one.
Remark : there is surely a best way to do this...
Bod
+++++++++++++++++++++++++++
>From David Gillies <daggilli@vader.brad.ac.uk>
Date: Mon, 09 Dec 1996 16:30:24 +0000
Organization: University of Bradford
Olivier Beaudoux wrote:
>
> Hi,
>
> You can use the copy/paste feature (scrap manager) with jGNE (a patch to
> the MacOS GetNextEvent function).
>
> 1. Get an event with jGNE that tell you about a mouse down or/and a key
> down.
> 2. Save the content of the scrap area (in an other buffer).
> 3. Generate a copy to see if scrap is empty or not. If not, you've get
> the name of the interest file/folder. If it's empty, generate a 'return'
> keydown event with the PostEvent function; redo the copy and it's now
> ok.
> 4. Restitute the saved scrap buffer to the real one.
>
> Remark : there is surely a best way to do this...
>
You're darn tootin' there is! I'm not even sure if this would work.
There is no supported way to get the Finder selection in any system
version prior to 7.5 (there is a sneaky, underhand method of vast
and sinister skankiness in earlier versions - it is abstruse in the
extreme).
The way to do it 7.5 is send a Get Selection apple event to the Finder.
Read Greg Anderson's article in develop 21.
--
______________________________________________________________________
David A. G. Gillies (daggilli@vader.brad.ac.uk)
University of Bradford, Bradford, West Yorkshire, England
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
+++++++++++++++++++++++++++
>From David Gillies <daggilli@vader.brad.ac.uk>
Date: Tue, 10 Dec 1996 14:51:53 +0000
Organization: University of Bradford
David Gillies wrote:
>
[stuff on getting the Finder selection]
> The way to do it 7.5 is send a Get Selection apple event to the Finder.
> Read Greg Anderson's article in develop 21.
>
Sorry - that should read develop 20
--
______________________________________________________________________
David A. G. Gillies (daggilli@vader.brad.ac.uk)
University of Bradford, Bradford, West Yorkshire, England
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
+++++++++++++++++++++++++++
>From h943318b@eds.ecip.nagoya-u.ac.jp (Kaneko Tetsuya )
Date: 12 Dec 1996 10:55:04 GMT
Organization: Education Center for Information Processing, Nagoya Univ.
Thank you, evetybody followed my question.
I understand that I need research Finder Scripting.
Tetsuya Kaneko
---------------------------
>From drelder@lisp.com.au (Matthew Elder)
Subject: Help with GetKeys();
Date: Mon, 16 Dec 1996 01:29:55 +1000
Organization: LISP
My name is Matthew Elder and I am fairly new at programming for the mac. I
am currrently trying to use the GetKeys() function but am having some
problems. I am wanting the computer to read the keymap. I then ask if a
particular key is down, in this case the up arrow (I think). It is not
acknowledging the key press. Can somebody show me where I am going wrong.
Thankyou.
void Events(void)
{
short HorDistance = 0;
short VerDistance = 0;
void DrawField(long HorDistance,long VerDistance);
KeyMap myKeyMap;
while (!Button())
{
GetKeys(myKeyMap);
if (myKeyMap[125])
{
VerDistance = VerDistance - 5;
}
DrawField( HorDistance, VerDistance);
}
}
+++++++++++++++++++++++++++
>From smfr@santafe.edu (Simon Fraser)
Date: Sun, 15 Dec 1996 02:08:15 -0700
Organization: Santa Fe Institute
In article <drelder-1612960129550001@lisp-ip75.lisp.com.au>,
drelder@lisp.com.au (Matthew Elder) wrote:
>My name is Matthew Elder and I am fairly new at programming for the mac. I
>am currrently trying to use the GetKeys() function but am having some
>problems. I am wanting the computer to read the keymap. I then ask if a
>particular key is down, in this case the up arrow (I think). It is not
>acknowledging the key press. Can somebody show me where I am going wrong.
>Thankyou.
>
[snip]
> GetKeys(myKeyMap);
>
> if (myKeyMap[125])
KeyMap is now defined as:
unsigned long KeyMap[4]
so by checking myKeyMap[125] you are looking at some long in memory
a loooong way off the end of the Key Map. ;-)
You'll need to work out which long contains the key you want,
and then check the appropriate bit with something like
if ((myKeyMap[2] & (1 << kArrowKeyByte)) != 0)...
(I made up those numbers).
HTH,
Simon
+++++++++++++++++++++++++++
>From matt@colorpar.com (Matt Gieselman)
Date: Mon, 16 Dec 1996 10:09:30 -0800
Organization: The Color Partnership
In article <drelder-1612960129550001@lisp-ip75.lisp.com.au>,
drelder@lisp.com.au (Matthew Elder) wrote:
> My name is Matthew Elder and I am fairly new at programming for the mac. I
> am currrently trying to use the GetKeys() function but am having some
> problems. I am wanting the computer to read the keymap. I then ask if a
> particular key is down, in this case the up arrow (I think). It is not
> acknowledging the key press. Can somebody show me where I am going wrong.
> Thankyou.
Matthew,
Here is a function youc an call with the keycode to see
if that key is down:
Boolean
KeyIsDown( UInt16 keyVal ) {
UInt8 theKeyMap[16];
::GetKeys( (UInt32 *)theKeyMap );
return( (theKeyMap[keyVal >> 3] >> (keyVal & 7)) & 1 );
} // end KeyIsDown
You could alternatively get the same info from the event
record if you are going through an event loop. If you
have Think Reference or the Inside Mac reference youshould
be able to get what values respond to what keys.
For the up arrow you would call as follows:
if ( KeyIsDown( 0x7E ) ) {
// Do something
}
Hope this helps,
Matt
- ------------------------------------------------------------
Matt Gieselman
Software Engineer and Juggler
The Color Partnership
matt@colorpar.com
www.colorpar.com
- -----------------------------------------------------------
+++++++++++++++++++++++++++
>From glen_yates@cpqm.NOSPAM.mail.saic.com (Glen Yates)
Date: Mon, 16 Dec 1996 13:23:02 -0600
Organization: SAIC
In article <smfr-1512960208150001@simon.santafe.edu>, smfr@santafe.edu
(Simon Fraser) wrote:
> In article <drelder-1612960129550001@lisp-ip75.lisp.com.au>,
> drelder@lisp.com.au (Matthew Elder) wrote:
>
> >My name is Matthew Elder and I am fairly new at programming for the mac. I
> >am currrently trying to use the GetKeys() function but am having some
> >problems. I am wanting the computer to read the keymap. I then ask if a
> >particular key is down, in this case the up arrow (I think). It is not
> >acknowledging the key press. Can somebody show me where I am going wrong.
> >Thankyou.
> >
> [snip]
> > GetKeys(myKeyMap);
> >
> > if (myKeyMap[125])
>
> KeyMap is now defined as:
>
> unsigned long KeyMap[4]
>
> so by checking myKeyMap[125] you are looking at some long in memory
> a loooong way off the end of the Key Map. ;-)
>
> You'll need to work out which long contains the key you want,
> and then check the appropriate bit with something like
>
> if ((myKeyMap[2] & (1 << kArrowKeyByte)) != 0)...
>
> (I made up those numbers).
Right, and for the lazy, the real numbers are:
myKeyMap[3] in which case the up arrow key is 64.
Of course you probably want the other arrow keys too, but knowing you
should be checking myKeyMap[3] you can easily find those values.
Regards,
Glen Yates ---- Remove .NOSPAM from my address to reply ----
---------------------------
>From bhutten@cochran.com (Bill Hutten)
Subject: How to find dirID of my application?
Date: Sun, 01 Dec 1996 17:30:43 -0500
Organization: Cochran Interactive
OK, I want to create a file or folder in the current directory (the
directory my application is in)....In order to create a FSSpec I need to
know the volume reference # and the parent directory ID...I assume I'm just
being stupid (yeah, for the first time.....) but how the heck do I find
these, assuming that my application can be moved anywhere (ie, I can't rely
on folders staying the same....)
thanks
- bill
+++++++++++++++++++++++++++
>From francois-regis.degott@imag.fr (Fr. Degott)
Date: 2 Dec 1996 11:40:49 GMT
Organization: LogiMath - LMC-IMAG - Grenoble
In article <bhutten-ya023180000112961730430001@news.nstn.ca>,
bhutten@cochran.com (Bill Hutten) wrote:
> OK, I want to create a file or folder in the current directory (the
> directory my application is in)....In order to create a FSSpec I need to
> know the volume reference # and the parent directory ID...I assume I'm just
> being stupid (yeah, for the first time.....) but how the heck do I find
> these, assuming that my application can be moved anywhere (ie, I can't rely
> on folders staying the same....)
Hi Bill,
the answer is in the Process Manager.
see the routines GetCurrentProcess(), GetProcessInformation(),
and the ProcessInfoRec structure.
HTH
Fr.
_____________________________________________________________________________
Fr. Degott (Francois-Regis.Degott@imag.fr)
LogiMath, Lab. LMC-IMAG - Grenoble - France
+++++++++++++++++++++++++++
>From j-norstad@nwu.edu (John Norstad)
Date: Mon, 02 Dec 1996 12:30:32 -0600
Organization: Northwestern University
In article <bhutten-ya023180000112961730430001@news.nstn.ca>,
bhutten@cochran.com (Bill Hutten) wrote:
> OK, I want to create a file or folder in the current directory (the
> directory my application is in)....In order to create a FSSpec I need to
> know the volume reference # and the parent directory ID...I assume I'm just
> being stupid (yeah, for the first time.....) but how the heck do I find
> these, assuming that my application can be moved anywhere (ie, I can't rely
> on folders staying the same....)
Use PBGetFCBInfo:
FCBPBRec pBlock;
OSErr err;
pBlock.ioNamePtr = nil;
pBlock.ioVRefNum = 0;
pBlock.ioRefNum = LMGetCurApRefNum();
pBlock.ioFCBIndx = 0;
err = PBGetFCBInfo(&pBlock, false);
if (err != noErr) {
/* pBlock.ioFCBVRefNum = vol ref num of dir containing app. */
/* pBlock.ioFCBParID = dir id of dir containing app. */
}
--
John Norstad
<mailto:j-norstad@nwu.edu>
<http://charlotte.acns.nwu.edu/jln/>
+++++++++++++++++++++++++++
>From Gideon Greenspan <gdg20@hermes.cam.ac.uk>
Date: Mon, 2 Dec 1996 18:02:39 +0000
Organization: University of Cambridge, England
> OK, I want to create a file or folder in the current directory (the
> directory my application is in)....In order to create a FSSpec I need to
> know the volume reference # and the parent directory ID...I assume I'm just
> being stupid (yeah, for the first time.....) but how the heck do I find
> these, assuming that my application can be moved anywhere (ie, I can't rely
> on folders staying the same....)
I'm not 100% sure about this one, but I've done some similar things.
Use the Process Manager to get Process Information on the current process.
Within this data structure there should be the FSSpec of where the app is
held on disk.
Gideon Greenspan
+++++++++++++++++++++++++++
>From bilewicz@helf4.physik.fu-berlin.de (Roger Bilewicz)
Date: 3 Dec 96 13:23:42 GMT
Organization: Freie Universitaet Berlin
bhutten@cochran.com (Bill Hutten) writes:
>OK, I want to create a file or folder in the current directory (the
>directory my application is in)....In order to create a FSSpec I need to
>know the volume reference # and the parent directory ID...I assume I'm just
>being stupid (yeah, for the first time.....) but how the heck do I find
>these, assuming that my application can be moved anywhere (ie, I can't rely
>on folders staying the same....)
Bill,
other suggestions which have already been made may work as well... here
comes mine:
1. take the handle to any of your resources (when initializing your
program, you will probably get a menu handle, for ex.) and call
HomeResFile (thisHandle) . You'll get the refNum of your program's
resource file. If you still didn't open other files, you could
likewise get CurResFile.
2. Take this refNum and get the FSSpec - if I'm not completely wrong,
there is a function in MoreFiles which does this. (Sorry, I cannot
check for the name right here)
May it help,
Roger
+++++++++++++++++++++++++++
>From David Gillies <daggilli@vader.brad.ac.uk>
Date: Wed, 04 Dec 1996 14:42:02 +0000
Organization: University of Bradford
John Norstad wrote:
>
> In article <bhutten-ya023180000112961730430001@news.nstn.ca>,
> bhutten@cochran.com (Bill Hutten) wrote:
>
> > OK, I want to create a file or folder in the current directory (the
> > directory my application is in)....In order to create a FSSpec I need to
> > know the volume reference # and the parent directory ID...I assume I'm just
> > being stupid (yeah, for the first time.....) but how the heck do I find
> > these, assuming that my application can be moved anywhere (ie, I can't rely
> > on folders staying the same....)
>
> Use PBGetFCBInfo:
>
> FCBPBRec pBlock;
> OSErr err;
>
> pBlock.ioNamePtr = nil;
> pBlock.ioVRefNum = 0;
> pBlock.ioRefNum = LMGetCurApRefNum();
> pBlock.ioFCBIndx = 0;
> err = PBGetFCBInfo(&pBlock, false);
> if (err != noErr) {
> /* pBlock.ioFCBVRefNum = vol ref num of dir containing app. */
> /* pBlock.ioFCBParID = dir id of dir containing app. */
> }
>
> --
> John Norstad
> <mailto:j-norstad@nwu.edu>
> <http://charlotte.acns.nwu.edu/jln/>
This will work, but it's talking to low memory globals, which the
Apple Thought Police say is bad karma. I use GetCurrentProcess()
followed by GetProcessInformation() to do this trick.
something like (off the top of my head)
ProcessSerialNumber psn;
ProcessInfoRec pInfo;
FSSpec myAppSpec;
GetCurrentProcess(&psn);
// initialise the fields - length of record, pointer to myAppSpec etc.
GetProcessInformation(&psn,&pInfo);
Check out IM VI or new IM: Processes
--
______________________________________________________________________
David A. G. Gillies (daggilli@vader.brad.ac.uk)
University of Bradford, Bradford, West Yorkshire, England
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
+++++++++++++++++++++++++++
>From bhamlin@zocalo.net (Brian Hamlin)
Date: 9 Dec 1996 21:50:29 GMT
Organization: Noesis Software Construction
In article <32A58DBA.73E5@vader.brad.ac.uk>, David Gillies
<daggilli@vader.brad.ac.uk> wrote:
stuff about GetProcessInfo and not talking to LoMem
CurrentAppName will always be around (and probably 99% of those others as well)
Try this:
FSSpec tSpec;
Str63 fldrStr, dName;
Str32 volName;
CInfoPBRec cipbr; // I use this 'cause I always get them mixed up
DirInfo *dPB = (DirInfo*)&cipbr;
short curVRefNum;
short modFileCnt, cnt, foundCnt;
unsigned long tType;
long modFldrID;
Size siz;
OSErr err;
// Find a list of files to be displayed
// Get Info on our App Folder
dPB->ioCompletion = 0;
dPB->ioNamePtr = dName;
dPB->ioVRefNum = 0;
dPB->ioFDirIndex = -1;
dPB->ioDrDirID = 0;
err = PBGetCatInfo( (CInfoPBPtr)dPB, false);
if ( err != noErr) {
ErrAlert( err, "\pfailed to find App's Folder");
return err;
}
// Get our vRefNum by making an FSSpec to our app...
err = FSMakeFSSpec( 0, dPB->ioDrDirID, LMGetCurApName(), &tSpec);
curVRefNum = tSpec.vRefNum;
modFldrID = dPB->ioDrDirID;
modFileCnt = dPB->ioDrNmFls;
// Allocate global File List
// start out with space for a few 'Specs
// helps avoid handle in the heap with no room to grow
sFileListH = (SDispFilesH)NewHandle( sizeof(SDispFiles)*6);
if ( sFileListH == 0) {
err=MemError();
ErrAlert( err, "\pAllocation problem while loading Files");
return err;
}
// Read the contents of our Folder
for ( foundCnt=0,cnt=1; cnt<=modFileCnt; cnt++) {
dPB->ioDrDirID = modFldrID;
dPB->ioFDirIndex = cnt;
if ( (err=PBGetCatInfo((CInfoPBPtr)dPB,false)) != noErr)
break; // bail if we fail, else
// check file type
tType = ((HFileInfo*)dPB)->ioFlFndrInfo.fdType;
if ( tType == 'PICT') // or something...
foundCnt++;
else
continue;
// Make FSSpec
err = FSMakeFSSpec( curVRefNum, modFldrID, dPB->ioNamePtr, &tSpec);
if ( err != noErr) break; // unlikely error, bail
siz = GetHandleSize((Handle)sFileListH);
if ( siz < foundCnt*sizeof(SDispFiles)) {
SetHandleSize( (Handle)sFileListH, (foundCnt+4)*sizeof(SDispFiles));
// allocate in chunks to speed things up a little...
if ( (err=MemError()) != noErr) {
ErrAlert( err, "\pAllocation problem while loading Files");
break;
}
}
//HLock( (Handle)sFileListH);
// no need to Lock, BlockMove/assign are safe
// Store the File Data
BlockMoveData( &tSpec, &((*sFileListH)[ foundCnt-1].dSpec),
sizeof(FSSpec));
(*sFileListH)[ foundCnt-1].dType = tType;
(*sFileListH)[ foundCnt-1].dDataSize = cipbr.hFileInfo.ioFlLgLen;
}
if ( foundCnt == 0) {
err = (-1);
ErrAlert( err, "\pNo Files found to Display!");
return err;
}
sFilesCnt = foundCnt;
sCurFile = 0;
return noErr;
}
--
Brian M Hamlin bhamlin@screenlight.com
NSC Software Construction (510) 271-7971
+++++++++++++++++++++++++++
>From Binky the Wonderwhorse <binky@mmcorp.com>
Date: 12 Dec 1996 17:28:53 GMT
Organization: Total Jihad, Inc
lo,
the following function expects a ptr to an already allocated FSSpec
structure. when it returns it fills out the FSSpec with data that points
ot your application. this gives your application name and the disk ID
that its running on and the id of the directory its running in.
// -------------------------------------------- OurProcessInfo
OSErr
OurProcessInfo(FSSpec *theFS)
{
OSErr iErr = noErr;
ProcessSerialNumber processNumber;
ProcessInfoRec processInfo;
iErr = GetCurrentProcess(&processNumber);
if (iErr)
goto bail;
processInfo.processInfoLength = sizeof(ProcessInfoRec);
processInfo.processName = NULL;
processInfo.processAppSpec = theFS;
iErr = GetProcessInformation(&processNumber, &processInfo);
bail:
return iErr;
}
===========================================================
Binky the Wonderwhorse
Macintosh Software Engineer, Unix SysAdmin, Webmaster, Spod
Multimedia Corporation, London
mail: binky@mmcorp.com
WWW : http://www.mmcorp.com/~binky
Cam : http://www.mmcorp.com/~binky/webcamtoo/
===========================================================
---------------------------
>From Paulin <st93eft3@dunx1.ocs.drexel.edu>
Subject: How to get one file at a time in a Mac directory
Date: 4 Dec 1996 08:14:43 GMT
Organization: SP extreme
I am at a lost so I hope someone here can assist me. Here is what I am
trying to do. I set up a while loop. I locate the volume reference
number and the directory ID. I go into that directory and I plan on
loading one file at a time. In my loop I load the file, get some needed
info from it, check the info, then move/delete the file if the info is
wrong.
So here is my question. How to I load one file at a time in my loop. Is
there some easy way to do it just by incramenting something in the
Paramblock of the Director ID, or something. Please help. This has been
killing me for the past 3 weeks. I can't seem to figure it out and the
Inside Macintosh books don't seem to be helping. If you can give info as
well as some example or a place to read up on it, I am all ears. Thanks
to anyone that can help.
And if you can please send me email directly. I don't get to the news
group to oftent. Thanks
steve
st93eft3@dunx1.ocs.drexel.edu
____________________________________________________________
Steve Paulin
SP extreme
SPextreme@newtower1-014.resnet.drexel.edu
http://144.118.247.241/
+++++++++++++++++++++++++++
>From refiegle@mail.delcoelect.com (Richard E. Fiegle)
Date: Fri, 06 Dec 1996 07:25:04 -0600
Organization: Delco Electronics
In article <583btj$d9s@noc2.drexel.edu>, Paulin
<st93eft3@dunx1.ocs.drexel.edu> wrote:
> I am at a lost so I hope someone here can assist me. Here is what I am
> trying to do. I set up a while loop. I locate the volume reference
> number and the directory ID. I go into that directory and I plan on
> loading one file at a time. In my loop I load the file, get some needed
> info from it, check the info, then move/delete the file if the info is
> wrong.
>
> So here is my question. How to I load one file at a time in my loop. Is
> there some easy way to do it just by incramenting something in the
> Paramblock of the Director ID, or something. Please help. This has been
> killing me for the past 3 weeks. I can't seem to figure it out and the
> Inside Macintosh books don't seem to be helping. If you can give info as
> well as some example or a place to read up on it, I am all ears. Thanks
> to anyone that can help.
void iterate_through_directory(short v_ref_num, long dir_id)
{
// Get catalog info on the directory to iterate through.
CInfoPBRec pb;
pb.hFileInfo.ioCompletion = nil; /* No completion routine */
pb.dirInfo.ioNamePtr = nil; /* Don't care about name */
pb.dirInfo.ioFDirIndex = -1; /* Use dirID */
pb.dirInfo.ioVRefNum = v_ref_num; /* Your volume ref num */
pb.dirInfo.ioDrDirID = dir_id; /* Your dirID */
OSErr error = PBGetCatInfoSync(&pb);
// If got info on directory OK, iterate through it.
if(noErr == error)
{
short num_items = pb.dirInfo.ioDrNmFls;
Str32 item_name;
// For all items in directory, get catalog info for the i-th item.
for(short i=1; i<=num_items; i++)
{
pb.dirInfo.ioNamePtr = (StringPtr)item_name; /* Returned name */
pb.dirInfo.ioVRefNum = v_ref_num; /* Volume */
pb.dirInfo.ioFDirIndex = i; /* Index # */
pb.dirInfo.ioDrDirID = dir_id; /* This Directory */
error = PBGetCatInfoSync(&pb);
// If got info on the i-th item OK, "process" it.
if(noErr == error)
{
// At this point, the CInfoPBRec pb is valid, and filled
// with all kinds of information about the item (file or
// folder). Consult IM IV, or NIM: Files for more info
// on the CInfoPBRec structure.
// So now you can process the item in whatever way you see
// fit. Note however, if you move or delete the item, you
// will have one less item in your directory, and your
// indices will get messed up.
// For example, if you move the item whose index is 4 to
// the trash, and there used to be 20 items in the dir-
// ectory, there will now only be 19 items in the directory,
// and the item that _was_ #5 (before the move) will now
// be #4, and you'll end up skipping it when you move on
// to #5 (the _new_ #5, which was #6 before -- basically,
// you end up only processing every other item).
// 2 ways around this that I know of: (1) do the for() loop
// backwards (i.e., for(short i=num_items; i>=1; i--)). This
// way, when you move item #4, you've already processed items
// 5 and above, so no problem. (2) build a linked list of
// the items to be moved within the for() loop, then process
// the list of items to be moved after the for() loop is
// completed.
} /* End if got info on i-th item OK */
} /* End for all items in the directory */
} /* End if got info on directory OK */
} /* End iterate_through_directory */
--
Richard E. Fiegle
Opinions expressed are mine, not necessarily those of my employer
+++++++++++++++++++++++++++
>From grayowl@sover.net (Vinay Prabhakar)
Date: Fri, 06 Dec 1996 09:15:52 -0500
Organization: Gray Owl Software
In article <583btj$d9s@noc2.drexel.edu>, Paulin
<st93eft3@dunx1.ocs.drexel.edu> wrote:
> I am at a lost so I hope someone here can assist me. Here is what I am
> trying to do. I set up a while loop. I locate the volume reference
> number and the directory ID. I go into that directory and I plan on
> loading one file at a time. In my loop I load the file, get some needed
> info from it, check the info, then move/delete the file if the info is
> wrong.
>
> So here is my question. How to I load one file at a time in my loop. Is
> there some easy way to do it just by incramenting something in the
> Paramblock of the Director ID, or something. Please help. This has been
> killing me for the past 3 weeks. I can't seem to figure it out and the
> Inside Macintosh books don't seem to be helping. If you can give info as
> well as some example or a place to read up on it, I am all ears. Thanks
> to anyone that can help.
>
> And if you can please send me email directly. I don't get to the news
> group to oftent. Thanks
>
> steve
I would check out the MoreFiles library for stuff like this. MoreFiles
comes with routines for looping through directories and the files in them
so you don't need to do the work for it. Try Apple's Web site to download
MoreFiles.
--
Vinay Prabhakar
Gray Owl Software
+++++++++++++++++++++++++++
>From David Gillies <daggilli@vader.brad.ac.uk>
Date: Mon, 09 Dec 1996 16:14:12 +0000
Organization: University of Bradford
Richard E. Fiegle wrote:
>
> In article <583btj$d9s@noc2.drexel.edu>, Paulin
> <st93eft3@dunx1.ocs.drexel.edu> wrote:
>
> > I am at a lost so I hope someone here can assist me. Here is what I am
> > trying to do. I set up a while loop. I locate the volume reference
> > number and the directory ID. I go into that directory and I plan on
> > loading one file at a time. In my loop I load the file, get some needed
> > info from it, check the info, then move/delete the file if the info is
> > wrong.
> >
> > So here is my question. How to I load one file at a time in my loop. Is
> > there some easy way to do it just by incramenting something in the
> > Paramblock of the Director ID, or something. Please help. This has been
> > killing me for the past 3 weeks. I can't seem to figure it out and the
> > Inside Macintosh books don't seem to be helping. If you can give info as
> > well as some example or a place to read up on it, I am all ears. Thanks
> > to anyone that can help.
>
> void iterate_through_directory(short v_ref_num, long dir_id)
> {
> // Get catalog info on the directory to iterate through.
>
> CInfoPBRec pb;
> pb.hFileInfo.ioCompletion = nil; /* No completion routine */
> pb.dirInfo.ioNamePtr = nil; /* Don't care about name */
> pb.dirInfo.ioFDirIndex = -1; /* Use dirID */
> pb.dirInfo.ioVRefNum = v_ref_num; /* Your volume ref num */
> pb.dirInfo.ioDrDirID = dir_id; /* Your dirID */
> OSErr error = PBGetCatInfoSync(&pb);
>
This would appear to be a bit redundant.
> // If got info on directory OK, iterate through it.
>
> if(noErr == error)
> {
> short num_items = pb.dirInfo.ioDrNmFls;
> Str32 item_name;
>
> // For all items in directory, get catalog info for the i-th item.
>
> for(short i=1; i<=num_items; i++)
> {
I would say it is better to do something like
OSErr fileErr;
short index=1;
do
{
pb.dirInfo.ioDrDirID=dir_id;
pb.dirInfo.ioFDirIndex=index++;
fileErr=PBGetCatInfoSync(&pb);
}while(fileErr==noErr);
since this eleiminates the need to county the files in the first
place. This is a matter of personal taste however.
Richard then mentions methods of tracking directory contents while
stuff is going on underneath - this is a perennial probelm and one which
I solve with linked lists, as he suggests. However, System 7 users
might like to consider the following: using FSSpecs is wasteful since
they take a minimum of 70 bytes even with optimal (memory-wise)
packing. I use file IDs instead. I have routines like the following:
#define kMaxFileIDs 100
typedef struct FileListElem
{
struct FileListElemPtr *next;
short numIDs;
short refNum[kMaxFileIDs];
long fileID[kMaxFileIDs];
}FileListElem *FileListElemPtr;
In the directory scanning routines I do something like this:
FileListElemPtr listHead=NULL;
AddListElem(&listHead);
fileErr=PBGetCatInfoSync(&pb);
if((fileErr==noErr)&&((pb.hFileInfo.ioFlAttrib&0x10)==0)) // it's a file
{
if(listHead->next.numIDs==kMaxFileIDs)
AddListElem(&listHead); // add an element to the list
FSMakeFSSpec(vRefNum,dirID,name,&tempFSS);
CreateFileID(&tempFSS,&fileID); // function to make a file ID
// and return it
listHead->next.refNum[listHead->next.numIDs]=vRefNum;
listHead->next.fileID[listHead->next.numIDs++]=fileID;
}
You can then do you stuff by iterating through the list. I use arrays
of refNums and fileIDs to cut down on the number of list allocations.
--
______________________________________________________________________
David A. G. Gillies (daggilli@vader.brad.ac.uk)
University of Bradford, Bradford, West Yorkshire, England
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
---------------------------
>From Joel May <jmay@merle.acns.nwu.edu>
Subject: Launch app with arg
Date: Thu, 12 Dec 1996 12:11:50 -0600
Organization: Harmonic Vision, Inc.
I need create a mini-app that launches Netscape then go directly
to our home page. I can launch Netscape OK (using LaunchApplication()),
but I don't know how to supply our www address as an argument.
I do know how to send a high-level event with LaunchApplication()
to get an app to open or save a file, but supplying a www address
to Netscape has nothing to do with files.
In Windows this is easy, its just an argument to the app, and the
app uses the old argc, argv[] business. How do I do the same thing
on the Mac.
Thanks in advance,
Joel
+++++++++++++++++++++++++++
>From blob@ricochet.NOSPAM.net
Date: Thu, 12 Dec 1996 20:56:04 -0800
Organization: (none)
In article <32B04AE6.4B3F@merle.acns.nwu.edu>, jmay@nwu.edu wrote:
> I need create a mini-app that launches Netscape then go directly
> to our home page.
> In Windows this is easy, its just an argument to the app, and the
> app uses the old argc, argv[] business. How do I do the same thing
> on the Mac.
Use the code on <ftp://ftpdev.apple.com> called LaunchWithDoc or read
technote 1002 at <http://devworld.apple.com/dev/technotes/tn/tn1002.html>
which has sample code included.
--
(Pointers to other Mac programming web sites at
<http://devworld.apple.com/dev/geeks.html>)
To reply personally, remove the anti-spam "NOSPAM." from the email address
in the header.
+++++++++++++++++++++++++++
>From balindauer@aol.com (BALindauer)
Date: 13 Dec 1996 07:47:12 GMT
Organization: AOL http://www.aol.com
>I need create a mini-app that launches Netscape then go directly
>to our home page. I can launch Netscape OK (using LaunchApplication()),
>but I don't know how to supply our www address as an argument.
>I do know how to send a high-level event with LaunchApplication()
>to get an app to open or save a file, but supplying a www address
>to Netscape has nothing to do with files.
No sweat. You need to send an AppleEvent to NetScape. You want to use
the Get URL AppleEvent (suite id = 'GURL', event id = 'GURL'). If you're
not familiar with AppleEvents, the following code should help. Error
checking is an exercise left to the reader, as are the MyLaunchApp and
ApplicationIsRunning calls.
8<-------------------------------------------- cut here
OSErr SendURL( Str255 theURL, FSSpec browserFS)
{
AEAddressDesc theTargetApp;
AEDesc theURLDesc;
OSErr err =
0;
AppleEvent aeEvent;
ProcessSerialNumber thePSN;
if ( !ApplicationIsRunning( browserFS, &thePSN))
{
err = MyLaunchApp( browserFS, &thePSN);
}
err = AECreateDesc( typeProcessSerialNumber, &thePSN, sizeof(
thePSN), &theTargetApp);
err = AECreateAppleEvent( 'GURL', 'GURL', &theTargetApp,
kAutoGenerateReturnID,
kAnyTransactionID, &aeEvent);
AEDisposeDesc( &theTargetApp);
err = AECreateDesc( typeChar, &theURL[1], theURL[0], &theURLDesc);
err = AEPutParamDesc( &aeEvent, keyDirectObject, &theURLDesc);
AEDisposeDesc( &theURLDesc);
err = AESend( &aeEvent, nil, kAENoReply, kAENormalPriority,
kAEDefaultTimeout,nil,nil);
AEDisposeDesc( &aeEvent);
return err;
}
8<-------------------------------------------- cut here
Hope this helps...
--Bradley
- --------------------------------------
Bradley Lindauer
Software Engineer, New Technologies Group
Miro Computer Products, Inc.
balindauer@aol.com
blind@miro.mirousa.com
+++++++++++++++++++++++++++
>From Kenneth Lu <kenlu@mit.edu>
Date: Fri, 13 Dec 1996 03:22:36 -0500
Organization: M.I.T.
In article <32B04AE6.4B3F@merle.acns.nwu.edu>, jmay@nwu.edu wrote:
> I need create a mini-app that launches Netscape then go directly
> to our home page.
> In Windows this is easy, its just an argument to the app, and the
> app uses the old argc, argv[] business. How do I do the same thing
> on the Mac.
If that's all you want to do.. there is NO PROGRAMMING NECESSARY!
Simply save a text file with only the url as its content.
Then edit the creator of the file to 'MOSS', which is Netscape's
creator, and the type to 'URL ' (u-r-l-space).
That's it! The file is now a Netscape url file.
When double-clicked, it will lead to you the url!
Ambrosia has this in their two latest games, Avara and Bubble Trouble..
they have files which link to their homepage.
-ToastyKen
- -----------------------------
| Kenneth Lu -- kenlu@mit.edu |
- -----------------------------
---------------------------
>From photopres@aol.com
Subject: Launching a program
Date: 10 Dec 1996 03:21:01 GMT
Organization: AOL http://www.aol.com
I have an app that launches an program via the Process Manager. I want the
Process Manager to send an 'odoc' Apple Event to the lanuched program. To
do this you send a Data type AppParameters along to the Process Manager
(Page 2-20 Process Manager Reference book Inside Mac). The problem is: How
in the world do you specify the file to be opened in the messageBuffer of
the AppParameters data type. I've tried passing an AEDesclist in there,
but that doesn't work. Any suggestions where I can look. I'm getting a
blister on my thumb, thumbing through Inside Mac. The only thing I can
find is on 2-21 in Process Manager Reference. Is says: The nature of this
data varies accourding to the event being sent. That's not much help!
Thanks
Jeff
photopres@aol.com
+++++++++++++++++++++++++++
>From andyb@apple.com (Andy Bachorski)
Date: Mon, 09 Dec 1996 23:43:49 -0700
Organization: (none)
In article <19961210032000.WAA03313@ladder01.news.aol.com>,
photopres@aol.com wrote:
>I have an app that launches an program via the Process Manager. I want the
>Process Manager to send an 'odoc' Apple Event to the lanuched program. To
>do this you send a Data type AppParameters along to the Process Manager
>(Page 2-20 Process Manager Reference book Inside Mac). The problem is: How
>in the world do you specify the file to be opened in the messageBuffer of
>the AppParameters data type. I've tried passing an AEDesclist in there,
>but that doesn't work.
Oh, but you got soooo close. What you need to do is build an 'odoc' Apple
event, specifying the Finder as the target, and the document to be opened
as the direct parameter, the pass this as the appParameter.
As has already been stated, see tech note 1002 for the details
Andy B
+++++++++++++++++++++++++++
>From blob@ricochet.NOSPAM.net
Date: Mon, 09 Dec 1996 21:53:46 -0700
Organization: (none)
In article <19961210032000.WAA03313@ladder01.news.aol.com>,
photopres@aol.com wrote:
>...How... do you specify the file to be opened in the messageBuffer of
> the AppParameters data type.
See technote 1002 at
<http://devworld.apple.com/dev/technotes/tn/tn1002.html> for an complete
discussion of this.
--
(Pointers to other Mac programming web sites at
<http://devworld.apple.com/dev/geeks.html>)
To reply personally, remove the anti-spam "NOSPAM." from the email address
in the header.
+++++++++++++++++++++++++++
>From jwwalker@kagi.com (James W. Walker)
Date: Mon, 09 Dec 1996 21:32:54 -0800
Organization: Nisus Software, Inc.
In article <19961210032000.WAA03313@ladder01.news.aol.com>,
photopres@aol.com wrote:
>I have an app that launches an program via the Process Manager. I want the
>Process Manager to send an 'odoc' Apple Event to the lanuched program. To
>do this you send a Data type AppParameters along to the Process Manager
>(Page 2-20 Process Manager Reference book Inside Mac). The problem is: How
>in the world do you specify the file to be opened in the messageBuffer of
>the AppParameters data type.
Apple has a "code snippet" for this, named LaunchWithDoc. You can find it
on developer CDs, or on the web site.
<http://devworld.apple.com/dev/techsupport/source/code/Snippets/Processes/La
unchWithDoc2.1/ReadMe.html>
--
-- Jim Walker <http://members.aol.com/jwwalker/>
+++++++++++++++++++++++++++
>From dmorrow@fast.net (Daniel Morrow)
Date: Wed, 11 Dec 1996 20:27:47 -0500
Organization: SDO
In article <andyb-0912962343500001@mg131-167.ricochet.net>,
andyb@apple.com (Andy Bachorski) wrote:
>In article <19961210032000.WAA03313@ladder01.news.aol.com>,
>photopres@aol.com wrote:
>
>>I have an app that launches an program via the Process Manager. I want the
>>Process Manager to send an 'odoc' Apple Event to the lanuched program. To
>>do this you send a Data type AppParameters along to the Process Manager
>>(Page 2-20 Process Manager Reference book Inside Mac). The problem is: How
>>in the world do you specify the file to be opened in the messageBuffer of
>>the AppParameters data type. I've tried passing an AEDesclist in there,
>>but that doesn't work.
>
>Oh, but you got soooo close. What you need to do is build an 'odoc' Apple
>event, specifying the Finder as the target, and the document to be opened
>as the direct parameter, the pass this as the appParameter.
>
>As has already been stated, see tech note 1002 for the details
>
>Andy B
Almost, but not quite. You forgot one crucial step:
After you create the 'odoc' event with the Finder as the target, and the
document as the direct parameter, you need to call "AECoerceDesc" to a
"typeAppParameters" Apple Event descriptor. The data handle of that Apple
Event can then be used for the AppParamters flag.
P.S. - I'm not sure if the actual type is "typeAppParameters" but it is
something close. Again, all the details are in technote 1002.
-Dan.
---------------------------
>From dunham@pensee.com (David Dunham)
Subject: Launching application by signature
Date: Tue, 17 Dec 1996 16:09:00 -0800
Organization: Pensee Corporation
Given an application's 4-character signature, is there any way to launch
it (presumably by sending an Apple Event to the Finder)?
It appears that to use PBDTGetAPPLSync I need to know what volume the
application is on. LaunchWithDoc2 (in Snippets) does a bunch of looping...
is this the only approach?
David Dunham Pensee Corporation dunham@pensee.com
Voice/Fax: 206 783 7404 http://www.pensee.com/dunham/
"I say we should listen to the customers and give them what they want."
"What they want is better products for free." --Scott Adams
+++++++++++++++++++++++++++
>From jeff@nts.com (Jeff Miller)
Date: Tue, 17 Dec 1996 18:01:00 -0800
Organization: Network TeleSystems, Inc.
In article <dunham-1712961609000001@white-rose.pensee.com>,
dunham@pensee.com (David Dunham) wrote:
> Given an application's 4-character signature, is there any way to launch
> it (presumably by sending an Apple Event to the Finder)?
Not that I know of. You can tell the Finder to launch an application
given an FSSpec, though.
> It appears that to use PBDTGetAPPLSync I need to know what volume the
> application is on. LaunchWithDoc2 (in Snippets) does a bunch of looping...
> is this the only approach?
This is what we do, and it works fine. Is there a reason you can't do that?
Jeff
- ----------------------------------------------------------
Jeff Miller | jeff@nts.com | Network TeleSystems, Inc.
- ----------------------------------------------------------
+++++++++++++++++++++++++++
>From mh@primenet.com (Mark Hartman)
Date: 17 Dec 1996 23:21:02 -0700
Organization: Mark Hartman Computer Solutions
In article <dunham-1712961609000001@white-rose.pensee.com>,
dunham@pensee.com (David Dunham) wrote:
>Given an application's 4-character signature, is there any way to launch
>it (presumably by sending an Apple Event to the Finder)?
Directly? No, not really. I've got a LaunchBySignature routine, but it
requires a whole bunch of support routines to do it right. Let me know if
you really want it.
======================================================================
Mark Hartman Computer Solutions - specializing in all things Macintosh
C C++ 4th Dimension Networking System design/architecture
tel +1(714)758.0640 -+- fax +1(714)999.5030 -+- e-mail mh@primenet.com
======================================================================
"But it's not a fair test! People LIKE to use the Macintosh!"
---------------------------
>From Johan <JSO0605@kp.ssdn.skelleftea.se>
Subject: PPC ExitToShell Patch?
Date: Mon, 16 Dec 1996 08:39:53 -0800
Organization: Skelleftea Kommun
Can anyone please tell me how to make a PPC ExitToShell Patch?
I need a PPC function of: AtExitToShell that i found in VideoToolbox.
- -
Johan Sˆrlin / johan.sorlin@mailbox.hogia.net
+++++++++++++++++++++++++++
>From mxmora@mxmdesigns.com (Matthew Xavier Mora)
Date: Mon, 16 Dec 1996 21:55:08 -0800
Organization: MXM DesignsÅ
In article <32B57B59.566A@kp.ssdn.skelleftea.se>,
JSO0605@kp.ssdn.skelleftea.se wrote:
> Can anyone please tell me how to make a PPC ExitToShell Patch?
> I need a PPC function of: AtExitToShell that i found in VideoToolbox.
Install a CFM Termination routine. In MW look in the Linker
pref panel (I think). Type in the name of the routine that you
want called when your app exits.
Xavier
--
Matthew Xavier Mora <mailto:mxmora@mxmdesigns.com>
<http://www.best.com/~mxmora/mxm.html>
+++++++++++++++++++++++++++
>From SouthSide@kagi.com (Bob Bradley)
Date: Mon, 16 Dec 1996 20:53:48 -0800
Organization: SPC
In article <32B57B59.566A@kp.ssdn.skelleftea.se>,
JSO0605@kp.ssdn.skelleftea.se wrote:
> Can anyone please tell me how to make a PPC ExitToShell Patch?
> I need a PPC function of: AtExitToShell that i found in VideoToolbox.
You can use the CFM Termination routine to do what an ExitToShell patch
would do for non-CFM 68K code. Otherwise, you just need to create a
RoutineDescriptor to your patched ExitToShell instead of passing just a
ProcPtr to SetToolTrapAddress.
Check out the Code Fragment Manager chapter in Inside Mac: PowerPC System
Software.
---------------------------
>From John Kelly <kellyj@advtech.uswest.com>
Subject: RPC for Macintosh
Date: Mon, 16 Dec 1996 11:17:19 -0700
Organization: U S West Advanced Technologies
Does anyone know where (or if) RPC tools have been ported to the Mac?
Many thanks,
--
John F. Kelly
- ---BEGIN GEEK CODE BLOCK-----
GS d s+:+ a C++(+++)$ ULC+++(++++)$ P+++ L+++>$ E-(---) W+(++) N++ !o
K-- w--- O M+ V-- PS++ PE- Y PGP t-- !5 X? R- tv b+++ DI+++ D-- G e+++
h--- r+++ y+++
- ----END GEEK CODE BLOCK------
+++++++++++++++++++++++++++
>From jpek@genecodes.com (Jeff Pek)
Date: 17 Dec 1996 17:25:50 GMT
Organization: Gene Codes Corp
In article <32B5922F.FF6D5DF@advtech.uswest.com>
John Kelly <kellyj@advtech.uswest.com> writes:
> Does anyone know where (or if) RPC tools have been ported to the Mac?
Try EZRPC from NobleNet - <http://www.noblenet.com>
hth - jeff
- ------
Jeff Pek
Development Manager
Gene Codes Corp - Ann Arbor, MI
jpek@genecodes.com
+++++++++++++++++++++++++++
>From noblenet@world.std.com (NobleNet Inc.)
Date: Thu, 19 Dec 1996 07:51:19 GMT
Organization: NobleNet, Inc.
In article <32B5922F.FF6D5DF@advtech.uswest.com>,
John Kelly <kellyj@advtech.uswest.com> wrote:
>Does anyone know where (or if) RPC tools have been ported to the Mac?
Please contact NobleNet for ONC/RPC tools and solutions for UNIX,
Windows (3.1/95/NT), Macintosh, VMS, OS/2, NetWare, VxWorks, etc.
NobleNet, Inc.
337 Turnpike Road
Southboro, MA 01772
Voice +1 508 460 8222
Fax +1 508 460 3456
<sales@noblenet.com>
<http://www.noblenet.com/>
PRESS RELEASE
For Immediate Release
For Further Information, Please Contact:
David Burns
Vice President of Marketing
NobleNet, Inc.
Voice: (508) 460-8222
FAX: (508) 460-3456
e-mail: david.burns@noblenet.com
"The Client/Server Toolkit for C and C++ Programmers"
New Book From NobleNet Turns Programmers Into Client/Server Experts
New York, October 8, 1996 -- NobleNet, Inc. today announced the availability
of its newly published book that turns C and C++ programmers into
client/server experts. Co-authored by middleware experts Steven Lemmo and
Rich Grehan, The Client/Server Toolkit for C and C++ Programmers is a self-
contained instructional tool that teaches programmers how to distribute any
application or Application Programming Interface (API) across a network.
The CD-ROM software included with The Client/Server Toolkit features a unique
Windows-based client/server simulator that lets programmers gain hands-on
experience in client/server partitioning. Programmers are guided through four
"real-world" client/server projects: distributed ODBC database, scanner
device, image engine, and datafeed. The authors expertise combined with a
Rapid Application Development (RAD) environment, demystifies the art of
distributing complex applications.
"I learned more about client/server development in the last three days of
reading your book than I learned in the past few years of doing C and C++
programming," said Pascal Specht, Technical Sales Engineer at Precision
Software in Paris, France.
"Our new book will help any C or C++ programmer that wants to learn about
state-of-the-art client/server computing," said Steve Lemmo, co-author and
Chief Technology Officer of NobleNet. "The techniques taught in the book will
help programmers learn to use the powerful Interface Definition Languages
(IDLs) found in today's most popular distributed computing middleware."
Beginning with a monolithic application, readers learn how to separate
programs into independent parts that communicate with each other. While other
books on client/server computing include sample code, The Client/Server
Toolkit goes further and delivers a true client/server Software Development
Toolkit (SDK) designed for application partitioning. Unlike other approaches,
programmers learn to build client/server applications using industry-standard
RPC technology that requires no source code changes.
"The Client/Server Toolkit is ideal for programmers that want to get a quick
immersion into client/server computing with tools that require very little
effort to learn," said Vincent Russo, Assistant Professor of Computer Science
at Purdue University. "I like the fact that the book is totally self-
contained. It has a wealth of real-world examples that provide the reader
with a thorough understanding of client/server development. And the simulator
gives programmers hands-on experience with building and running real
client/server applications."
Although The Client/Server Toolkit is written for C and C++ programmers,
examples are given that show "drag and drop" programmers how to create
client/server applications utilizing popular GUI front-ends such as Visual
Basic, PowerBuilder, Delphi, and Developer 2000. Distributed with the book is
a free version of NobleNet's powerful standards-based RPC product used by
client/server developers world-wide. Programmers are presented with client
and server Windows connected by a simulated network. Using NobleNet RPC,
applications developed on the simulator are easily deployed to over 40
platforms including 26 UNIXes, Windows 3.1, 95, and NT, NetWare, Macintosh,
OS/2, and VMS. More than 20 Windows-based TCP/IP stacks are supported to
ensure operation in existing multi-vendor environments.
Co-author Steven Lemmo founded NobleNet, engineered NobleNet's first software
product, EZ-RPC(R), and led the team that developed the company's NetWare and
Windows-based middleware tools. With an in-depth understanding of both
communication and application software, he is a sought after consultant on RPC
programming. Steve has over fifteen years of experience in software
engineering and tools development in companies such as Computervision Corp.,
Sun Microsystems, Inc., and Xerox Imaging Systems, Inc. He is widely
recognized as an expert on distributed computing and is frequently called upon
to appear at industry forums.
Co-author Rick Grehan has been on the editorial staff of BYTE Magazine for
over 11 years. He is currently the Technical Director of BYTE Labs and the
author of BYTE's monthly CodeTalk column. His articles have appeared in BYTE,
Embedded Systems Programming, and Forth Dimensions. In addition, he was a
contributor to the 1993 edition of The Encyclopedia of Microcomputers,
published by Marcel Dekker, Inc. Rick is also the designer of BYTE Magazine's
BYTEmark benchmark suite.
The Client/Server Toolkit for C and C++ Programmers is published by NobleNet.
The 350 page book with CD-ROM can be ordered for $49.95 by calling (800)-250-
6427 or (508)-893-0398.
NobleNet offers tools for distributed client/server development for procedural
and object paradigms. Incorporated in 1991, NobleNet is a world leader in
Remote Procedure Call (RPC) technology and has won numerous awards for its RPC
product family. NobleNet also distributes IONA Technologies' industry-
leading "Orbix" CORBA-compliant Object Request Broker. The company is
headquartered in Southboro, MA, and can be reached at (508) 460-8222 or at
<http://www.noblenet.com/>.
---------------------------
>From "Jon Espen Carlsen" <jonec@online.no>
Subject: Shutdown utility for mac
Date: 12 Dec 1996 19:58:48 GMT
Organization: Telenor Online Public Access
Anyone who knows of a util that displays a image (pict/bmp etc.) for a short
while before restarting or shutting down the mac (Macos 7.5.3)???
Jon Espen Carlsen
+++++++++++++++++++++++++++
>From "Jon Espen Carlsen" <jonec@online.no>
Date: 13 Dec 1996 18:59:29 GMT
Organization: Telenor Online Public Access
> >Anyone who knows of a util that displays a image (pict/bmp etc.) for a
short
> >while before restarting or shutting down the mac (Macos 7.5.3)???
>
>
> You might be able to do something with the "Shutdown Items"
> items folder in the system. Simplest solution would be
> to include a graphic document in that folder with the
> message/image you want displayed...
>
Yes I know, but Shutdown Items only opens the file in the application that
created the document.
I would like to see a utility who displays a image for a brief time before
shutting down without any user influence on the programme.
Any ideas?
Jon Espen Carlsen
+++++++++++++++++++++++++++
>From Online@MacTech.com ( nick.c @MT )
Date: Thu, 12 Dec 1996 17:46:30 -0800
Organization: MacTech Magazine
"Jon Espen Carlsen" <jonec@online.no> wrote:
>Anyone who knows of a util that displays a image (pict/bmp etc.) for a short
>while before restarting or shutting down the mac (Macos 7.5.3)???
You might be able to do something with the "Shutdown Items"
items folder in the system. Simplest solution would be
to include a graphic document in that folder with the
message/image you want displayed...
____Nicholas C. DeMello, Ph.D.___________________________________________
"MacTech Online"--MacTech Magazine, for Mac OS Programmers and Developers
http://www.MacTech.com/
_/ _/ _/ _/_/_/ _/ _/
Chemistry: Nick@chem.UCLA.edu _/_/ _/ _/ _/ _/ _/_/_/
MacTech: Online@MacTech.com _/ _/_/ _/ _/ _/ _/
http://www.chem.ucla.edu/~nick/ _/ _/ _/_/_/ _/ _/
+++++++++++++++++++++++++++
>From Joseph Strout <jstrout@ucsd.edu>
Date: Fri, 13 Dec 1996 15:45:10 -0800
Organization: The Avant-Garde of the Now, Ltd.
On 13 Dec 1996, Jon Espen Carlsen wrote:
> > >Anyone who knows of a util that displays a image (pict/bmp etc.) for a
> short
> > >while before restarting or shutting down the mac (Macos 7.5.3)???
> >
> > You might be able to do something with the "Shutdown Items"
> > items folder in the system. Simplest solution would be
> > to include a graphic document in that folder with the
> > message/image you want displayed...
>
> Yes I know, but Shutdown Items only opens the file in the application that
> created the document.
> I would like to see a utility who displays a image for a brief time before
> shutting down without any user influence on the programme.
So write a little Applescript that displays a picture for a few seconds,
then exits. To display the picture, I think you could use
GraphicConverter, JPEGview, clip2gif, etc. Put the Applescript in your
Shutdown Items folder once you've got it working.
,------------------------------------------------------------------.
| Joseph J. Strout Department of Neuroscience, UCSD |
| jstrout@ucsd.edu http://www-acs.ucsd.edu/~jstrout/ |
`------------------------------------------------------------------'
---------------------------
>From ghinkle@red.seas.upenn.edu (Gregory J Hinkle)
Subject: [Q] Bringing my application to front
Date: 5 Dec 1996 00:21:40 GMT
Organization: University of Pennsylvania
What does it entail to bring a process to the foreground. I am writing an
application that after certain periods of inactivity will come to front
and perform tasks. (Screen Saver etc.) Does anyone know of a relativly
simple way to do this(I don't want to break what works so far). Thanks
for any help.
--
*******************************************************************************
* _/_/_/ _/ _/ | University of Pennsylvania, School of Engineering *
* _/ _/ _/ _/ |---------------------------------------------------- *
* _/ _/ _/ | Box 0859 | Drive Defensivly... *
* _/ _/_/ _/_/_/_/ | 3901 Locust Walk | Buy a Tank. *
* _/ _/ _/ _/ | Philadelphia, Pa 19104 | --Greg Hinkle-- *
* _/_/ _/ _/ |-----------------------------------------------------*
*_______________________| http://homepage.seas.upenn.edu/~ghinkle/ *
* Greg Hinkle | ghinkle@eniac.seas.upenn.edu *
*******************************************************************************
+++++++++++++++++++++++++++
>From davea@atlas.co.uk (Dave)
Date: Thu, 05 Dec 1996 15:47:15 +0000
Organization: Atlas Internet
Firstly your signature is bigger than your message!
The process Manager will do the job for you.
You want to call GetCurrentProcess to find your own Process Serial Number
, then SetFrontProcess passing the Process Serial Number returned.
Dave
ie,
OSErr iErr;
ProcessSerialNumber PSN;
iErr = GetCurrentProcess(&PSN);
iErr = SetFrontProcess(&PSN);
/*add error handling*/
You may like to check if you are the front process by calling:
iErr = GetFrontProcess(&PSN);
and comparing it against your process serial number using _SameProcess
OSErr iErr;
ProcessSerialNumber PSN,PSN2;
Boolean result;
iErr = SameProcess(&PSN,&PSN2,&result);
The result is a Boolean.
You must use SameProcess to compare two processes, the interpretation of
the bits in the process serial number is internal to the process manager.
In article <5854ik$1ve@netnews.upenn.edu>, ghinkle@red.seas.upenn.edu
(Gregory J Hinkle) wrote:
> What does it entail to bring a process to the foreground. I am writing an
> application that after certain periods of inactivity will come to front
> and perform tasks. (Screen Saver etc.) Does anyone know of a relativly
> simple way to do this(I don't want to break what works so far). Thanks
> for any help.
>
> --
+++++++++++++++++++++++++++
>From bhamlin@zocalo.net (Brian Hamlin)
Date: 9 Dec 1996 21:59:41 GMT
Organization: Noesis Software Construction
In article <davea-0512961547150001@193.131.167.44>, davea@atlas.co.uk
(Dave) wrote:
> You want to call GetCurrentProcess to find your own Process Serial Number
> , then SetFrontProcess passing the Process Serial Number returned.
A couple of gotcha's..
Note that SetFrontProcess() is a request to send to the front. You aren't
in the front when it returns, and you may not come to the front at all !
So use the following:
>
> You may like to check if you are the front process by calling:
> iErr = GetFrontProcess(&PSN);
> and comparing it against your process serial number using _SameProcess
> OSErr iErr;
> ProcessSerialNumber PSN,PSN2;
> Boolean result;
>
> iErr = SameProcess(&PSN,&PSN2,&result);
>
> The result is a Boolean.
> You must use SameProcess to compare two processes, the interpretation of
> the bits in the process serial number is internal to the process manager.
>
If there is a ModalDialog up in the foreground, you won't swap.
(for example)
--
Brian M Hamlin bhamlin@screenlight.com
NSC Software Construction (510) 271-7971
---------------------------
>From zaphod@dna.ca (Zaphod)
Subject: [Q] Fading in Thousands
Date: Tue, 3 Dec 1996 19:25:04 -0500
Organization: dna.ca
It appears that use color table fading doesn't work in thousands of
colours mode.
Anybody have any source for such a task? Perhaps even some pointers in
the right direction?
I wonder if it's even possible...
-Zaphod.
- ---------------------------------------------------------------
- Brian Cantin, a.k.a. Zaphod (zaphod@dna.ca) -
- Co-owner of Euphoria Cyberware (cp820@freenet.carleton.ca) -
- Computer Programming : The leading cause of caffine addiction -
- ---------------------------------------------------------------
+++++++++++++++++++++++++++
>From fprefect@ambrosiasw.com (Matt Slot)
Date: Wed, 04 Dec 1996 11:14:09 -0500
Organization: Ambrosia Software
> It appears that use color table fading doesn't work in thousands of
> colours mode.
> Anybody have any source for such a task? Perhaps even some pointers in
> the right direction?
> I wonder if it's even possible...
Check out the updated Color Gamma library which can fade a monitor at any
depth to a given color. Demo and source are available at Info-Mac and other
archives:
<ftp://mirrors.aol.com/pub/info-mac/dev/lib/color-gamma-10-c.hqx>
Matt
* * * * * * * * * * * * * * * * * * * * * * * * * * ======================
* Reality: Matt Slot, Bitwise Operator * Time is an illusion.
* E-Mail: mailto:fprefect@umich.edu * Lunchtime doubly so.
* Web: http://www.sils.umich.edu/~fprefect/ * -- Douglas Adams
* * * * * * * * * * * * * * * * * * * * * * * * * * ======================
+++++++++++++++++++++++++++
>From "Rick Genter" <rgenter@5dgames.com>
Date: 4 Dec 1996 15:10:49 GMT
Organization: 5D Games, Inc.
You need to use a gamma fade. There is code on the net; do a search for
"gamma fade". The source I've seen is in Pascal.
--
Rick Genter
VP of R&D
5D Games, Inc.
rgenter@5dgames.com
<http://www.5dgames.com>
Zaphod <zaphod@dna.ca> wrote in article
<msg5258.thr-14ecea.4c4dc6@dna.ca>...
> It appears that use color table fading doesn't work in thousands of
> colours mode.
> Anybody have any source for such a task? Perhaps even some pointers in
> the right direction?
> I wonder if it's even possible...
>
> -Zaphod.
>
> -----------------------------------------------------------------
> - Brian Cantin, a.k.a. Zaphod (zaphod@dna.ca) -
> - Co-owner of Euphoria Cyberware (cp820@freenet.carleton.ca) -
> - Computer Programming : The leading cause of caffine addiction -
> -----------------------------------------------------------------
>
+++++++++++++++++++++++++++
>From alexr@bungie.com (Alex Rosenberg)
Date: Wed, 04 Dec 1996 09:34:23 -0600
Organization: Hackers Anonymous
In article <msg5258.thr-14ecea.4c4dc6@dna.ca>, zaphod@dna.ca (Zaphod) wrote:
>It appears that use color table fading doesn't work in thousands of
>colours mode.
You're looking for the cscDirectSetEntries call to the video driver.
- ----------------------------------------------------
| Alexander M. Rosenberg <mailto:alexr@bungie.com>|
| Bungie Software <http://www.bungie.com> |
| Nobody cares what I say. |
+++++++++++++++++++++++++++
>From Kenneth Lu <kenlu@mit.edu>
Date: Tue, 17 Dec 1996 17:14:51 -0500
Organization: M.I.T.
Try downloading Ingemar Ragnemalm's Sprite Animation Toolkit (SAT).
It's available on Info-Mac.
It has an addon library that does clut animations (for any depth) with
source code.
-ToastyKen
- -----------------------------
| Kenneth Lu -- kenlu@mit.edu |
| http://mit.edu/kenlu/www/ |
- -----------------------------
---------------------------
>From David Reiss <reiss@astro.washington.edu>
Subject: [Q] Playing QT Movies Backwards?
Date: Mon, 02 Dec 1996 15:40:43 -0800
Organization: http://www.astro.washington.edu/reiss
How does one do this (in code)? I know it's possible, but I can't find
any seemingly relevant calls in the Movies.h header.
Thanks for any info.
-David
+++++++++++++++++++++++++++
>From trickys@ix.netcom.com (Tricky S)
Date: Mon, 02 Dec 1996 20:15:36 -0600
Organization: Tricky S Software Factory
In article <32A368FB.488@astro.washington.edu>, David Reiss
<reiss@astro.washington.edu> wrote:
> How does one do this (in code)? I know it's possible, but I can't find
> any seemingly relevant calls in the Movies.h header.
>
> Thanks for any info.
>
> -David
Try this:
#define BACKWARDS_HALF_SPEED 0xFFFF8000 // reverse, 1/2 speed
#define BACKWARDS_1_SPEED 0xFFFF0000 // reverse, normal speed
#define BACKWARDS_2_SPEED 0xFFFE0000 // reverse, 2X speed
// some variables...
Movie gMoviel;
MovieController gController;
....
// later in your code, when you want to play
// an opened movie backwards, do this:
ComponentResult result;
// play backwards at normal speed
result = MCDoAction( gController, mcActionPlay, (Ptr)BACKWARDS_1_SPEED);
Hope that helps,
-S
_____________
\ ____________\
|| _________ | Stefan Sinclair
|| /@--------\ | <mailto:trickys@ix.netcom.com>
|| | | | <http://members.aol.com/trickys/>
|| | | |
|| \_________/ |
|| ____ |
|| o Mac |
\|_____________|
\|___________|
+++++++++++++++++++++++++++
>From kfalk@rogerswave.ca (Eric Falk)
Date: Wed, 04 Dec 1996 15:43:33 -0800
Organization: Cool Dude
In article <32A368FB.488@astro.washington.edu>, David Reiss
<reiss@astro.washington.edu> wrote:
> How does one do this (in code)? I know it's possible, but I can't find
> any seemingly relevant calls in the Movies.h header.
>
> Thanks for any info.
>
> -David
Heres how is MCDoAction: (in C)
MCDoAction( theController, X, (Ptr)True );
X = 0xFFFF8000 back half speed
0xFFFF0000 back normal
0xFFFE0000 back double speed
or sometthing like this. Or while the movie's open shift double click the movie.
Eric Falk
+++++++++++++++++++++++++++
>From Maf Vosburgh <maf@mmcorp.com>
Date: 10 Dec 1996 19:04:20 GMT
Organization: MultiMedia Corporation
In article <32A368FB.488@astro.washington.edu> David Reiss,
reiss@astro.washington.edu writes:
>How does one do this (in code)? I know it's possible, but I can't find
>any seemingly relevant calls in the Movies.h header.
Set the rate to -1.
Maf
---------------------------
>From hsoi@eden.com (John C. Daub)
Subject: [Q] Show-Hide menubar with QuickTime??
Date: Sun, 08 Dec 1996 16:28:39 -0600
Organization: Hsoi's Shop
Hi all!
I know how to show/hide the menu bar with my own code, but I remember
reading something somewhere that this was finally implimented in the
toolbox.
like a part of QuickTime 2.1 or something.
Any information on this? (docs, what headers, prototypes, minimal system
requirement (I think just QT 2.1)), etc.
thanx.
Oh, please post the response but also email me it too. Thanx :)
--
John C. Daub (aka Hsoi)
<mailto:hsoi@eden.com> <http://www.eden.com/~hsoi/>
"I'm suckin' up more karma than I need...
So have a supernova on me" - Dave Wyndorf
+++++++++++++++++++++++++++
>From Dave Howell <dshowell@worldnet.att.net>
Date: Mon, 09 Dec 1996 23:19:17 -0800
Organization: Pablo Media
John C. Daub sez:
>
> Hi all!
>
> I know how to show/hide the menu bar with my own code, but I remember
> reading something somewhere that this was finally implimented in the
> toolbox.
>
> like a part of QuickTime 2.1 or something.
>
> Any information on this? (docs, what headers, prototypes, minimal system
> requirement (I think just QT 2.1)), etc.
>
> thanx.
John,
Maybe what you're referring to is one of the QuickTime samples, a
MovieController component written by John Wang in Apple DTS. The
MovieController inherits everything from the standard MovieController
component but also lets you hit the tab key to play back full-screen
with no menu bar. Check out the source code to this sample.
Another approach might be to use the DrawSprocket, but depending on what
you're doing this might be overkill, and it only runs on PowerPC.
Dave
___________________________ ___ _ _ __ __ _ _
Dave Howell | o \___| |_| | ___ | \/ |___ _| |_| ___
Pablo Media | _/ o | o \ |/ o \ | | | | o_\/ o | |/ o |
___________________________|_| \___|___/_|\___/ |_|\/|_|___/\___|_|\___|
+++++++++++++++++++++++++++
>From bitzm@apple.com (Mike Bitz)
Date: Tue, 10 Dec 1996 12:03:30 -0700
Organization: Apple Computer, Inc.
> > I know how to show/hide the menu bar with my own code, but I remember
> > reading something somewhere that this was finally implimented in the
> > toolbox.
BeginFullScreen and EndFullScreen were introduced with QuickTime 2.1.
When your code is bracketed by these calls, QuickTime will hide the
menubar, clear the screen corners, and create a background color matte if
necessary.
These functions are documented in the QuickTime 2.1 developer note which
is available on the Internet at:
<ftp://ftpdev.info.apple.com/Developer_Services/Development_Kits/QuickTime/Programming_Stuff/QT_2.1_for_Developers.sit.hqx>
-Mike
bitzm@apple.com
+++++++++++++++++++++++++++
>From squires@crl.com (Scott Squires)
Date: Tue, 10 Dec 1996 23:19:34 -0800
Organization: Puffin Designs
In article <32AD0EF4.72E7@worldnet.att.net>,
Dave Howell <dshowell@worldnet.att.net> wrote:
>John C. Daub sez:
>>
>> Hi all!
>>
>> I know how to show/hide the menu bar with my own code, but I remember
>> reading something somewhere that this was finally implimented in the
>> toolbox.
>>
>> like a part of QuickTime 2.1 or something.
>>
>> Any information on this? (docs, what headers, prototypes, minimal system
>> requirement (I think just QT 2.1)), etc.
>>
>> thanx.
>
>John,
>
>Maybe what you're referring to is one of the QuickTime samples, a
>MovieController component written by John Wang in Apple DTS. The
>MovieController inherits everything from the standard MovieController
>component but also lets you hit the tab key to play back full-screen
>with no menu bar. Check out the source code to this sample.
>
>Another approach might be to use the DrawSprocket, but depending on what
>you're doing this might be overkill, and it only runs on PowerPC.
>
Actually QuickTime has calls specifically for this.
Check in Movies.h QT header. These will auto-resize a multisync monitor to
display a smaller image if you want as well. Check out the flags in the
same file.
-scott
OSErr BeginFullScreen(Ptr *restoreState, GDHandle whichGD, short
*desiredWidth, short *desiredHeight, WindowPtr *newWindow, RGBColor
*eraseColor, long flags)
pascal OSErr EndFullScreen(Ptr fullState, long flags)
Scott Squires "Insert funny stuff here"
squires@crl.com
ScottSquir@aol.com
---------------------------
>From craig@epic.co.uk (Craig Emery)
Subject: [Q] Suspended or Hidden: How do I tell?
Date: Tue, 10 Dec 1996 17:42:14 +0000
Organization: Epic Miltimedia Group
Dear All,
does anyone know if there is a way to tell if a suspend event relates
to losing focus or actually being hidden?
I'm a cross-platform (Mac and PC) programmer and am trying to find a
metaphore for the PC's minimise / maximise and simply losing focus. ;-)
TIA.
Craig.
-----------------------------------------------------------------------
| Norman Craig Emery B.Sc., craig@epic.co.uk |
| Team Leader / Senior CDi Programmer & CRAIG.EPIC@applelink.apple.com |
| Macintosh Programming Coordinator, Voice: +44 (0) (1273) 320637 |
| The Epic Multimedia Group, Fax: +44 (0) (1273) 821567 |
| http://www.epic.co.uk/ |
| VPS House, 52 Old Steine, Brighton, East Sussex, BN1 1NH, U.K. |
-----------------------------------------------------------------------
+++++++++++++++++++++++++++
>From dmorrow@fast.net (Daniel Morrow)
Date: Wed, 11 Dec 1996 20:33:12 -0500
Organization: SDO
In article <craig-ya023180001012961742140001@proxy.epic.co.uk>,
craig@epic.co.uk (Craig Emery) wrote:
> Dear All,
>
> does anyone know if there is a way to tell if a suspend event relates
>to losing focus or actually being hidden?
>
> I'm a cross-platform (Mac and PC) programmer and am trying to find a
>metaphore for the PC's minimise / maximise and simply losing focus. ;-)
>
>TIA.
>Craig.
>
You can only tell if your process is the front-most process. Basically you
call GetCurrentProcess and GetFrontProcess and compare the two
ProcessSerialNumbers.
But there is no way to tell if your program is hidden. Only the System
know that, and it's not telling.
-Dan.
+++++++++++++++++++++++++++
>From Michael Rayter <mirayter@worldnet.att.net>
Date: Wed, 11 Dec 1996 23:45:35 -0800
Organization: AT&T WorldNet Services
> You can only tell if your process is the front-most process. Basically you
> call GetCurrentProcess and GetFrontProcess and compare the two
> ProcessSerialNumbers.
>
> But there is no way to tell if your program is hidden. Only the System
> know that, and it's not telling.
>
> -Dan.
No, there must be a way. In Script Editor, we can find out
the value of property 'visible' of object 'application process'.
That means sending an appropriate Apple Event to Finder (or compiling
and executing a script from within the application). But I believe
there is something less complicated.
---------------------------
>From stian@mail.utexas.edu (Stian Oksavik)
Subject: [Q] Useful error messages?
Date: 7 Dec 1996 18:10:41 GMT
Organization: University of Texas at Austin
Currently, whenever my program encounters an error as the result of a
toolbox call, it will call an error handler with the result code of the
call. For example, a missing resource will result in the handler
displaying a dialog:
Sorry, a fatal error occurred.
System error: Unknown error (ID -192)
How do I make my code display more informative messages, like
Sorry, a fatal error occured.
System error: Resource not found (-192)
There must be a way of doing this, since I see alerts like this in the
system software and in other programs. Considering the number of errors
that one can potentially get, I find it unlikely that every program is
expected to know the meaning of all these and include appropriate English
error messages. Using CW10, in case this is in a header file somewhere.
Any hints on how to do this will be very welcome.
Thanks,
-Stian
+++++++++++++++++++++++++++
>From stian@mail.utexas.edu (Stian Oksavik)
Date: 9 Dec 1996 10:43:31 GMT
Organization: University of Texas at Austin
In article <58d2p9$h7t@netnews.upenn.edu>, kurisuto@babel.ling.upenn.edu
(Sean Crist) wrote:
[snip]
> The system doesn't provide you any help here; it's up to you to provide the
> text. However, since the majority of errors never come up in finished
> apps, you just need to decide which one's you're going to supply text for
> (disk full, read/write error, etc.). A good programming strategy is to
> have a single routine for error reporting which you call from throughout
> your program. You store meaningful strings for the more common errors in a
> STR# resource, and stick this text into your alert using ParamText.
>
> If the sample alert text you've provided is supposed to be only for
> programmer consumption (for debugging purposes), it doesn't matter too much
> how you word your alert. But you intend the user to see this text, then
> you should read "Macintosh Human Interface Guidelines" for recommendations
> about how to make your text more useful to the user. For example, if your
> app gets a "resource not found" error when opening a user-created document,
> you should say something like 'The document "My Document" could not be
> opened, because it appears to be damaged (-192).' This will be much less
> opaque to the user.
The way my application currently works is to tell the user:
Sorry, a fatal error has occurred:
Wrong password (internal error ID = 5)
[Quit]
for system errors, it currently says:
Sorry, a fatal error has occurred:
Unknown error (system error ID = -192)
The ID number in the case of system errors is obtained either by a call to
ResError(), QDError() or whatever is appropriate, or simply as the return
value from a toolbox call.
In this project, 90% of the code is for handling things like multitasking,
Apple Events, window updates, errors, etc ad nauseum. My next project will
probably be to write a tiny application shell for use in future projects.
(I know that many already exist, but I think I want to write my own to
keep it lean and small.)
For now, I guess my users will just have to put up with Unknown errors.
Most such errors are handled internally in my application before they ever
reach the error handler, so a missing resource would most likely result in
Sorry, a fatal error has occurred:
AccessMaster has been tampered with (internal error ID = 8)
[Quit]
So hopefully, system errors shouldn't show up too often. And if they do,
hey, it'll be freeware - you get what you pay for ;-)
-Stian
+++++++++++++++++++++++++++
>From David Reiss <reiss@astro.washington.edu>
Date: Tue, 10 Dec 1996 17:41:56 -0800
Organization: http://www.astro.washington.edu/reiss
I've seen a publicly available set of STR# resources with strings for
the most
common type of error you get in a Mac app. The index of the string
corresponds
to the error number, so it should be as easy as...
void DoError( OSErr inErr ) {
Str255 errStr;
GetIndString( errStr, myErrorStrings, inErr );
ParamText( errStr, "\p", "\p", "\p" ); // or whatever
Alert( myAlertRsrcID ); // Not sure of the exact form of this call...
}
Search the info-mac site for these resources...
-David
Stian Oksavik wrote:
>
> In article <58d2p9$h7t@netnews.upenn.edu>, kurisuto@babel.ling.upenn.edu
> (Sean Crist) wrote:
>
> [snip]
>
> > The system doesn't provide you any help here; it's up to you to provide the
> > text. However, since the majority of errors never come up in finished
> > apps, you just need to decide which one's you're going to supply text for
> > (disk full, read/write error, etc.). A good programming strategy is to
> > have a single routine for error reporting which you call from throughout
> > your program. You store meaningful strings for the more common errors in a
> > STR# resource, and stick this text into your alert using ParamText.
> >
> > If the sample alert text you've provided is supposed to be only for
> > programmer consumption (for debugging purposes), it doesn't matter too much
> > how you word your alert. But you intend the user to see this text, then
> > you should read "Macintosh Human Interface Guidelines" for recommendations
> > about how to make your text more useful to the user. For example, if your
> > app gets a "resource not found" error when opening a user-created document,
> > you should say something like 'The document "My Document" could not be
> > opened, because it appears to be damaged (-192).' This will be much less
> > opaque to the user.
>
> The way my application currently works is to tell the user:
>
> Sorry, a fatal error has occurred:
> Wrong password (internal error ID = 5)
> [Quit]
>
> for system errors, it currently says:
>
> Sorry, a fatal error has occurred:
> Unknown error (system error ID = -192)
>
> The ID number in the case of system errors is obtained either by a call to
> ResError(), QDError() or whatever is appropriate, or simply as the return
> value from a toolbox call.
>
> In this project, 90% of the code is for handling things like multitasking,
> Apple Events, window updates, errors, etc ad nauseum. My next project will
> probably be to write a tiny application shell for use in future projects.
> (I know that many already exist, but I think I want to write my own to
> keep it lean and small.)
>
> For now, I guess my users will just have to put up with Unknown errors.
> Most such errors are handled internally in my application before they ever
> reach the error handler, so a missing resource would most likely result in
>
> Sorry, a fatal error has occurred:
> AccessMaster has been tampered with (internal error ID = 8)
> [Quit]
>
> So hopefully, system errors shouldn't show up too often. And if they do,
> hey, it'll be freeware - you get what you pay for ;-)
>
> -Stian
+++++++++++++++++++++++++++
>From jlha@se.bel.alcatel.be (Jaime Lopez Hartmann)
Date: 12 Dec 1996 08:00:01 GMT
Organization: Alcatel/Bell
Hi,
Isn't it possible to use <errno.h> and <string.h> to be able
to call strerror() ? and thus get the text that goes with the error???
cheers,
In article <58d2p9$h7t@netnews.upenn.edu>, kurisuto@babel.ling.upenn.edu (Sean Crist) writes:
|>[...]
|>>How do I make my code display more informative messages, like
|>>
|>>Sorry, a fatal error occured.
|>>System error: Resource not found (-192)
|>>
|>>There must be a way of doing this, since I see alerts like this in the
|>>system software and in other programs. Considering the number of errors
|>>that one can potentially get, I find it unlikely that every program is
|>>expected to know the meaning of all these and include appropriate English
|>>error messages. Using CW10, in case this is in a header file somewhere.
|>
|>The system doesn't provide you any help here; it's up to you to provide the
|>text. However, since the majority of errors never come up in finished
|>apps, you just need to decide which one's you're going to supply text for
|>(disk full, read/write error, etc.). A good programming strategy is to
|>have a single routine for error reporting which you call from throughout
|>your program. You store meaningful strings for the more common errors in a
|>STR# resource, and stick this text into your alert using ParamText.
|>
|>[...]
--
Jaime Lopez Hartmann PhD e-mail: jlha@se.bel.alcatel.be
Alcatel Bell Antwerp-Belgium (Dept. se123) Phone:(32) 3 240 41 45
It is nice to be important, it is more important to be nice!
---------------------------
End of C.S.M.P. Digest
**********************